Hi, Bailu,

by default FastBit does not index TEXT columns.  Furthermore, a TEXT
column can only support index type 'keywords' and you have to
explicitly specify the index option in order for FastBit to build a
keyword index on the column.

If you intent to treat each row as an atomic unit, then it is better
for you to use the function addCategories instead of addText.

John


On 5/29/13 12:59 PM, Bailu Ding wrote:
> Hi,
> 
> I am using FastBit JNI to build indexes. I have a problem when I try
> to build indexes of both integer and text columns. Here is the process
> to reproduce the problem:
> 
> = Load an integral column with FastBit.add_longs() and
> FastBit.write_buffer().
> = Load a text column with FastBitStringWriter.addText() and
> FastBitStringWriter.addStringColumnToMetadata()
> = At this time, the -part.txt is correctly constructed for the two
> columns.
> = Then I run FastBit.build_indexes(). Only the intergral column has an
> index. The -part.txt file now only contains the metadata for the
> intergral column.
> 
> Is this the right way to build indexes on a mix of integral and text
> columns?
> 
> I paste the code here:
> 
> import gov.lbl.fastbit.FastBit;
> import gov.lbl.fastbit.FastBitStringWriter;
> import gov.lbl.fastbit.FastBitStringWriterException;
> 
> public class FastBitTest {
> 
>     public static void main(String args[]) throws
> FastBitStringWriterException
>     {
>         String[] strArr = {"0", "1", "2", "3"};
>         long[] intArr = {4, 5, 6, 7};
>         String partName = "/path/to/the/data/folder";
>         FastBit fb = new FastBit(null);
>         FastBitStringWriter writer = new FastBitStringWriter();
>        
>         fb.add_longs("long", intArr);
>         fb.write_buffer(partName);
>        
>         writer.addText(partName, "str", strArr, "UTF-8");
>         writer.addStringColumnToMetadata(partName, "str", "text");
>        
>         fb.build_indexes(partName, "basic");
>     }
> }
> 
> 
> Cheers,
> Bailu
> 
> 
> 
> _______________________________________________
> FastBit-users mailing list
> [email protected]
> https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users
> 
_______________________________________________
FastBit-users mailing list
[email protected]
https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users

Reply via email to