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 Chang Wang <ch...@gmail.com> on 2017/09/15 02:41:51 UTC

Search on field returns documents that should not match

Hello All,


I am confused by the field search behavior of solr (6.6), and hope someone
can help me understand the results.

For example,
I search "fit you handgun" on the field of "title_lemma".
http://localhost:8983/solr/bkb4/select?fq=doc_type:
document&indent=on&q=title_lemma:%20fit%20you%20handgun&wt=json

The first returned result is a good one which contains "fit you handgun" in
"title_lemma" field, the 2nd and 3rd results do not contain any of those
query words at all. Why are these documents still returned?

I attach the screen shot.


There is a related question. When I do not index the field "title_lemma",
solr gui
still allows me to search on that field and returns the result. Why does it
happen?
My understanding is that if a field is not indexed, it should not be
searchable at all.

Thank you,
Chang

RE: Search on field returns documents that should not match

Posted by Jagdish Vasani <Ja...@thedigitalgroup.com>.
Hi Chang Wang,

Searching is worng here, q=title_lemma: fit you handgun
It will search  title_lemma: fit or  _text:you  or _text:handgun (if stop words are not excluded)
Here _text is default search field , you might have different default search field.

Try search like q=title_lemma:(fit you handgun)
That will search any words in field title_lemma

Fire below query, you will get proper result,
http://localhost:8983/solr/bkb4/select?fq=doc_type:document&indent=on&q=title_lemma:(fit you handgun)&wt=json

Thanks,
Jagdish
From: Chang Wang [mailto:changwangbw@gmail.com]
Sent: Friday, September 15, 2017 8:12 AM
To: solr-user@lucene.apache.org
Subject: Search on field returns documents that should not match

Hello All,


I am confused by the field search behavior of solr (6.6), and hope someone
can help me understand the results.

For example,
I search "fit you handgun" on the field of "title_lemma".
http://localhost:8983/solr/bkb4/select?fq=doc_type:document&indent=on&q=title_lemma:%20fit%20you%20handgun&wt=json

The first returned result is a good one which contains "fit you handgun" in "title_lemma" field, the 2nd and 3rd results do not contain any of those query words at all. Why are these documents still returned?

I attach the screen shot.


There is a related question. When I do not index the field "title_lemma", solr gui
still allows me to search on that field and returns the result. Why does it happen?
My understanding is that if a field is not indexed, it should not be searchable at all.

Thank you,
Chang
________________________________

NOTICE TO RECIPIENT(s):This e-mail message may contain confidential or legally privileged information and is intended only for the use of the intended recipient(s). Any unauthorized disclosure, dissemination, distribution, copying or the taking of any action in reliance on the information herein is prohibited. E-mails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, or contain viruses. Although The Digital Group has taken reasonable precautions to ensure no viruses are present in this email, the company cannot accept responsibility for any loss or damage arising from the use of this email or attachments. Any opinion defamatory or deemed to be defamatory or any material which could be reasonably branded to be a species of plagiarism and other statements contained in this message and any attachment are solely those of the author and do not necessarily represent those of the company.