javalucenefull-text-searchluke

Lucene - Cannot find value in field via query


I'm new in lucene and I'm trying to find all documents with a exact value in exact field.

In index (using luke) is visible, that field __r_ani contains numeric value 567248953

__r_ani

But when I try to search in this index, lucene returns no results. I tried these queries:

__r_ani:567248953
__r_ani:"567248953"
__r_ani:[* TO *]

Is posible, that field has a bad name (beggining with 2 underscore characters)? Or it is possible, that field has bad configuration? (tokenized, indexed, stored, etc...)?

Edit: I just found, that my collegue is indexing it as StoredField. I tried index it as StringField and searching now works. I still don't understand, why I cant find it by query, when it is indexed as StoredField.


Solution

  • When I will use StoredField only, then value is stored, but not indexed. Luke is lying, that value is indexed. After indexing that value to field (with StringField or Double/LongPoint) search works.