Re: Question about PhraseQuery's capacity...

2020-01-10 Thread 小鱼儿
explain api helps! thanks for hint~! I have found out that one case failed becaused i carelessly add another filter condition, but the other case (which is analyzed into 30 terms) still failed, doesn't know why I guess i need to write a unit testcase to use MultiTerms.getTerms API to find out if

Re: Question about PhraseQuery's capacity...

2020-01-10 Thread 小鱼儿
After i directly call Analyzer.tokenStream() method to extract terms from query, i still cannot get results. Doesn't know the why... Code when build index: IndexWriterConfig iwc = new IndexWriterConfig(analyzer); //new SmartChineseAnalyzer(); Code do query: (1) extract terms from

Re: Question about PhraseQuery's capacity...

2020-01-10 Thread Mikhail Khludnev
Hello, Sometimes IndexSearcher.explain(Query, int) allows to analyse mismatches. On Fri, Jan 10, 2020 at 1:13 PM 小鱼儿 wrote: > After i directly call Analyzer.tokenStream() method to extract terms from > query, i still cannot get results. Doesn't know the why... > > Code when build index: >

What's the difference between LatLonPoint and LatLonDocValuesField?

2020-01-10 Thread 小鱼儿
In my understanding from reading the oniline documentation, LatLonPoint is used for BKD indexing, and LatLonDocValuesField is used for Sort argument's input. But does it means if a POI has a GeoPoint type "location" field, then i must add the same location value to the 2 fields which makes me

Question about PhraseQuery's capacity...

2020-01-10 Thread 小鱼儿
I use SmartChineseAnalyzer to do the indexing, and add a document with a TextField whose value is a long sentence, when anaylized, will get 18 terms. & then i use the same value to construct a PhraseQuery, setting slop to 2, and adding the 18 terms concequently... I expect the search api to find

Re: Question about PhraseQuery's capacity...

2020-01-10 Thread Adrien Grand
It should match. My guess is that you might not reusing the same positions as set by the analysis chain when creating the phrase query? Can you show us how you build the phrase query? On Fri, Jan 10, 2020 at 9:24 AM 小鱼儿 wrote: > I use SmartChineseAnalyzer to do the indexing, and add a document

Re: What's the difference between LatLonPoint and LatLonDocValuesField?

2020-01-10 Thread Adrien Grand
Your understanding is correct. It is common to index geo points by creating a LatLonPoint, a LatLonDocValuesField and a StoredField. Even though LatLonDocValuesField is stored in the index, the fact it's column-stored makes it a good choice for sorting or facets, but a poor choice to retrieve

Re: Question about PhraseQuery's capacity...

2020-01-10 Thread 小鱼儿
Hi Adrien, I find i might make a mistake: There is 2 level processing in a Analyzer class: one is Tokenizer, which is HMMChineseTokenizer, and the other is Analyzer which may apply some filtering... I'm using lucene's default interface to set a Analyzer instance to do the indexing,