terrier-org / terrier-core

Terrier IR Platform
http://terrier.org/
Other
254 stars 62 forks source link

Question: empty search results for field queries #3

Closed khui closed 7 years ago

khui commented 7 years ago

Hi,

I am using v4.2 in my Java application. This is a question rather than a bug report since I haven't digged deeply into the code. Any hints would be appreciated.

I issued field query as follows: BODY:(term1 term2 term3 .. ) (also tried: BODY:term1 BODY:term2 ....) and the returned ResultSet includes 0 documents. If I issued the same query without field, namely, term1 term2..., reasonable search results are returned. The query parsetrees (from srq.getQuery().parseTree()) and some logs are as follows.

former: MultiTermQuery(FieldQuery(SingleTermQuery(term1)),FieldQuery(SingleTermQuery(term2)),FieldQuery(SingleTermQuery(term3)))

logs:

[PostingListManager]- Query GenericQuery with 3 terms has 3 posting lists [Matching]- Number of docs with +ve score: 1000 [BooleanScoreModifier]- BooleanScoreModifier modified score for 0 documents [Matching]- number of retrieved documents: 1000 [Manager]- Found 1000 documents with a score of negative infinity in the result set returned, they will be removed. [Manager]- No filters, just Crop: 0, length0 [Manager]- Resultset is now 0 long

latter: MultiTermQuery(SingleTermQuery(term1),SingleTermQuery(term2),SingleTermQuery(term3))

logs:

[PostingListManager]- Query GenericQuery with 3 terms has 3 posting lists [Matching]- Number of docs with +ve score: 1000 [BooleanScoreModifier]- BooleanScoreModifier modified score for 0 documents [Matching]- number of retrieved documents: 1000 [Manager]- Found 0 documents with a score of negative infinity in the result set returned, they will be removed. [Manager]- No filters, just Crop: 0, length0 [Manager]- Resultset is now 1000 long

I also tried with single term query for both and got similar results.

Moreover, I also examined index.getCollectionStatistics().getNumberOfFields(), as well as the index property file, and both included/recorded the correct fields.

I would like to ask whether I missed some important configuration? Or there might be sth wrong with my index.

cmacdonald commented 7 years ago

Hi Kai,

Thanks for your question. Such questions can also be posted on the Forum (http://terrier.org/forum/). The current semantics of Terrier is that it operates like a filter for fields, proximities etc. See http://terrier.org/docs/current/querylanguage.html

The semantics are changing for Terrier 5. However, its not ready for public consumption yet ;-)

Craig

khui commented 7 years ago

Got it, thank you @cmacdonald.

Kai