You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Erick Erickson <er...@gmail.com> on 2013/11/01 12:35:26 UTC

Re: Store Solr OpenBitSets In Solr Indexes

Why are you saving this? Because if the bitset you're saving
has anything to do with, say, filter queries, it's probably useless.

The internal bitsets are often based on the internal Lucene doc ID,
which will change when segment merges happen, thus the caution.

Otherwise, theres the binary type you can probably use. It's not very
efficient since I believe it uses base-64 encoding under the covers
though...

Is this an "XY" problem?

Best,
Erick


On Wed, Oct 30, 2013 at 8:06 AM, David Philip
<da...@gmail.com>wrote:

> Hi All,
>
> What should be the field type if I have to save solr's open bit set value
> within solr document object and retrieve it later for search?
>
>   OpenBitSet bits = new OpenBitSet();
>
>   bits.set(0);
>   bits.set(1000);
>
>   doc.addField("SolrBitSets", bits);
>
>
> What should be the field type of  SolrBitSets?
>
> Thanks
>

Re: Store Solr OpenBitSets In Solr Indexes

Posted by Erick Erickson <er...@gmail.com>.
If the bitset is something you control you can use the binary
field type, although it's not a horribly efficient way to store binary
data.

If the bitset is bounded, you could do something with indexing
N long values that will contain the set and write a custom
similarity class to work with it.

Best,
Erick


On Sat, Nov 2, 2013 at 9:19 AM, David Philip <da...@gmail.com>wrote:

> Oh fine. Caution point was useful for me.
> Yes I wanted to do something similar to filer queries. It is not XY
> problem. I am simply trying to implement  something as described below.
>
> I have a [non-clinical] group sets in system and I want to build bitset
> based on the documents belonging to that group and save it.
> So that, While searching I want to retrieve similar bitset from Solr engine
> for matched document and then execute logical XOR. [Am I clear with problem
> explanation now?]
>
>
> So what I am looking for is, If I have to retrieve bitset instance from
> Solr search engine for the documents matched, how can I get it?
> And How do I save bit mapping for the documents belonging to a particular
> group. thus enable XOR operation.
>
> Thanks - David
>
>
>
>
>
>
>
>
>
>
> On Fri, Nov 1, 2013 at 5:05 PM, Erick Erickson <erickerickson@gmail.com
> >wrote:
>
> > Why are you saving this? Because if the bitset you're saving
> > has anything to do with, say, filter queries, it's probably useless.
> >
> > The internal bitsets are often based on the internal Lucene doc ID,
> > which will change when segment merges happen, thus the caution.
> >
> > Otherwise, theres the binary type you can probably use. It's not very
> > efficient since I believe it uses base-64 encoding under the covers
> > though...
> >
> > Is this an "XY" problem?
> >
> > Best,
> > Erick
> >
> >
> > On Wed, Oct 30, 2013 at 8:06 AM, David Philip
> > <da...@gmail.com>wrote:
> >
> > > Hi All,
> > >
> > > What should be the field type if I have to save solr's open bit set
> value
> > > within solr document object and retrieve it later for search?
> > >
> > >   OpenBitSet bits = new OpenBitSet();
> > >
> > >   bits.set(0);
> > >   bits.set(1000);
> > >
> > >   doc.addField("SolrBitSets", bits);
> > >
> > >
> > > What should be the field type of  SolrBitSets?
> > >
> > > Thanks
> > >
> >
>

Re: Store Solr OpenBitSets In Solr Indexes

Posted by David Philip <da...@gmail.com>.
Oh fine. Caution point was useful for me.
Yes I wanted to do something similar to filer queries. It is not XY
problem. I am simply trying to implement  something as described below.

I have a [non-clinical] group sets in system and I want to build bitset
based on the documents belonging to that group and save it.
So that, While searching I want to retrieve similar bitset from Solr engine
for matched document and then execute logical XOR. [Am I clear with problem
explanation now?]


So what I am looking for is, If I have to retrieve bitset instance from
Solr search engine for the documents matched, how can I get it?
And How do I save bit mapping for the documents belonging to a particular
group. thus enable XOR operation.

Thanks - David










On Fri, Nov 1, 2013 at 5:05 PM, Erick Erickson <er...@gmail.com>wrote:

> Why are you saving this? Because if the bitset you're saving
> has anything to do with, say, filter queries, it's probably useless.
>
> The internal bitsets are often based on the internal Lucene doc ID,
> which will change when segment merges happen, thus the caution.
>
> Otherwise, theres the binary type you can probably use. It's not very
> efficient since I believe it uses base-64 encoding under the covers
> though...
>
> Is this an "XY" problem?
>
> Best,
> Erick
>
>
> On Wed, Oct 30, 2013 at 8:06 AM, David Philip
> <da...@gmail.com>wrote:
>
> > Hi All,
> >
> > What should be the field type if I have to save solr's open bit set value
> > within solr document object and retrieve it later for search?
> >
> >   OpenBitSet bits = new OpenBitSet();
> >
> >   bits.set(0);
> >   bits.set(1000);
> >
> >   doc.addField("SolrBitSets", bits);
> >
> >
> > What should be the field type of  SolrBitSets?
> >
> > Thanks
> >
>