开发者

Lucene searching by numeric values

开发者 https://www.devze.com 2022-12-13 17:46 出处:网络
I\'m building a Java Lucene-based search system that, on addition, adds a certain number of meta-fields, one of which is a sourceId field, which denot开发者_开发问答es where the entry came from.

I'm building a Java Lucene-based search system that, on addition, adds a certain number of meta-fields, one of which is a sourceId field, which denot开发者_开发问答es where the entry came from.

I'm now trying to retrieve all documents from a particular source, but the index doesn't appear to be able to find them. However, if I search for a wildcard value, the returned documents all have the correct value for this field.

The lucene query I'm using is quite simple, basically index-source-id:1 but that fails to return any hits, if I search for content:a* I get dozens of documents, all of which, when asked, return the value 1 for the index-source-id value, which is correct.

Any ideas?


I have only worked with the PHP port, however, have you checked what text analyzer you are using? This FAQ seems to indicate that like the PHP version, you need to use a diffrent one that doesn't remove digits.
You can find a list of analyzers here

Just to be sure, you have set the id to be indexable?

0

精彩评论

暂无评论...
验证码 换一张
取 消