You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by bgd <wo...@yahoo.com> on 2010/03/10 22:48:51 UTC

search on documents which DO NOT have field defined

Hi,
I have a bunch of documents which do not have a particular field  
defined. How can define a query do retrieve only those documents?

Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Sharding of Indexes in clucene

Posted by Anshum <an...@gmail.com>.
Hi Suman,
Your question is about clucene, perhaps this place would help you better
with it.
http://lucene.apache.org/lucy/mailing_lists.html#Users
Also, talking this question off hand, lucene as such does not support
straight off sharding of indexes, you'd have to split the index at the
document level using a mechanism created and maintained by you.
There ofcourse are implementation schemes that you might want to try so as
to split the index and query them using the appropriate searcher, but this
logic has to be handled by you.

--
Anshum Gupta
Naukri Labs!
http://ai-cafe.blogspot.com

The facts expressed here belong to everybody, the opinions to me. The
distinction is yours to draw............


On Thu, Mar 11, 2010 at 12:32 PM, <su...@zapak.co.in> wrote:

>
> Hi,
>
> Does the clucene have the concept of Sharding of Indexes.
> How much performance boost it provides in case of searching.Can we mention
> to get documents from a perticular shard only, so as to reduce the set of
> documents to be searched from.
>
>
> Regards,
> Suman
>
> > Oops. I was thinking solr.
> >
> > How about this, to find docs that don't have a value in the weight field?
> >
> >    TermRangeQuery trq = new TermRangeQuery("weight", null, null, true,
> > true
> > );
> >
> >     BooleanQuery bq = new BooleanQuery();
> >
> >     bq.add(new MatchAllDocsQuery(), BooleanClause.Occur.MUST);
> >
> >     bq.add(trq, BooleanClause.Occur.MUST_NOT);
> >
> >
> >
> > Tom
> >
> >
> > On Wed, Mar 10, 2010 at 2:11 PM, Tom Hill <so...@worldware.com>
> wrote:
> >
> >> Try
> >>
> >> -fieldname:[* TO *]
> >>
> >> as in
> >>
> >>
> >>
> http://localhost:8983/solr/select/?q=-weight%3A[*+TO+*]&version=2.2&start=0&rows=10&indent=on
> >>
> >> Tom
> >>
> >> On Wed, Mar 10, 2010 at 1:48 PM, bgd
> >> <wo...@yahoo.com>wrote:
> >>
> >>> Hi,
> >>> I have a bunch of documents which do not have a particular field
> >>> defined.
> >>> How can define a query do retrieve only those documents?
> >>>
> >>> Thanks!
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> >>> For additional commands, e-mail: java-user-help@lucene.apache.org
> >>>
> >>>
> >>
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Sharding of Indexes in clucene

Posted by su...@zapak.co.in.
Hi,

Does the clucene have the concept of Sharding of Indexes.
How much performance boost it provides in case of searching.Can we mention
to get documents from a perticular shard only, so as to reduce the set of
documents to be searched from.


Regards,
Suman

> Oops. I was thinking solr.
>
> How about this, to find docs that don't have a value in the weight field?
>
>    TermRangeQuery trq = new TermRangeQuery("weight", null, null, true,
> true
> );
>
>     BooleanQuery bq = new BooleanQuery();
>
>     bq.add(new MatchAllDocsQuery(), BooleanClause.Occur.MUST);
>
>     bq.add(trq, BooleanClause.Occur.MUST_NOT);
>
>
>
> Tom
>
>
> On Wed, Mar 10, 2010 at 2:11 PM, Tom Hill <so...@worldware.com> wrote:
>
>> Try
>>
>> -fieldname:[* TO *]
>>
>> as in
>>
>>
>> http://localhost:8983/solr/select/?q=-weight%3A[*+TO+*]&version=2.2&start=0&rows=10&indent=on
>>
>> Tom
>>
>> On Wed, Mar 10, 2010 at 1:48 PM, bgd
>> <wo...@yahoo.com>wrote:
>>
>>> Hi,
>>> I have a bunch of documents which do not have a particular field
>>> defined.
>>> How can define a query do retrieve only those documents?
>>>
>>> Thanks!
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>>
>>>
>>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: search on documents which DO NOT have field defined

Posted by Anshum <an...@gmail.com>.
Hi,

How about indexing a dummy token for empty docs? that way you may pick up
all docs that are actually null/empty by querying for the dummy token.
Make sure that the dummy token is never a part of any actual document (token
stream).
Perhaps this should work!

--
Anshum Gupta
Naukri Labs!
http://ai-cafe.blogspot.com

The facts expressed here belong to everybody, the opinions to me. The
distinction is yours to draw............


On Thu, Mar 11, 2010 at 4:34 AM, Tom Hill <so...@worldware.com> wrote:

> Oops. I was thinking solr.
>
> How about this, to find docs that don't have a value in the weight field?
>
>   TermRangeQuery trq = new TermRangeQuery("weight", null, null, true, true
> );
>
>    BooleanQuery bq = new BooleanQuery();
>
>    bq.add(new MatchAllDocsQuery(), BooleanClause.Occur.MUST);
>
>    bq.add(trq, BooleanClause.Occur.MUST_NOT);
>
>
>
> Tom
>
>
> On Wed, Mar 10, 2010 at 2:11 PM, Tom Hill <so...@worldware.com> wrote:
>
> > Try
> >
> > -fieldname:[* TO *]
> >
> > as in
> >
> >
> >
> http://localhost:8983/solr/select/?q=-weight%3A[*+TO+*]&version=2.2&start=0&rows=10&indent=on
> >
> > Tom
> >
> > On Wed, Mar 10, 2010 at 1:48 PM, bgd <woods5242-photography@yahoo.com
> >wrote:
> >
> >> Hi,
> >> I have a bunch of documents which do not have a particular field
> defined.
> >> How can define a query do retrieve only those documents?
> >>
> >> Thanks!
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> >> For additional commands, e-mail: java-user-help@lucene.apache.org
> >>
> >>
> >
>

Re: search on documents which DO NOT have field defined

Posted by Tom Hill <so...@worldware.com>.
Oops. I was thinking solr.

How about this, to find docs that don't have a value in the weight field?

   TermRangeQuery trq = new TermRangeQuery("weight", null, null, true, true
);

    BooleanQuery bq = new BooleanQuery();

    bq.add(new MatchAllDocsQuery(), BooleanClause.Occur.MUST);

    bq.add(trq, BooleanClause.Occur.MUST_NOT);



Tom


On Wed, Mar 10, 2010 at 2:11 PM, Tom Hill <so...@worldware.com> wrote:

> Try
>
> -fieldname:[* TO *]
>
> as in
>
>
> http://localhost:8983/solr/select/?q=-weight%3A[*+TO+*]&version=2.2&start=0&rows=10&indent=on
>
> Tom
>
> On Wed, Mar 10, 2010 at 1:48 PM, bgd <wo...@yahoo.com>wrote:
>
>> Hi,
>> I have a bunch of documents which do not have a particular field defined.
>> How can define a query do retrieve only those documents?
>>
>> Thanks!
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>

Re: search on documents which DO NOT have field defined

Posted by Tom Hill <so...@worldware.com>.
Try

-fieldname:[* TO *]

as in

http://localhost:8983/solr/select/?q=-weight%3A[*+TO+*]&version=2.2&start=0&rows=10&indent=on

Tom

On Wed, Mar 10, 2010 at 1:48 PM, bgd <wo...@yahoo.com>wrote:

> Hi,
> I have a bunch of documents which do not have a particular field defined.
> How can define a query do retrieve only those documents?
>
> Thanks!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>