Re: what's replacement of FieldCache in Lucene 7

2018-04-12 Thread Yonghui Zhao
My case is when I get some docs from lucene, I need also get some field value of the retrieved docs. For example in lucene 4, I use FieldCache like this. FieldCache.DEFAULT.getTerms(reader, name, false).get(locDocId).utf8ToString(); FieldCache.DEFAULT.getInts(reader, name,

SimpleQueryParser does not tokenize on NOT operator

2018-04-12 Thread Michael Sokolov
I ran into a problem parsing queries like "cat -tiger" with this setup: SimpleQueryParser configured with NOT_OPERATOR and *without* WHITESPACE_OPERATOR In this case, the whole string "cat -tiger" is passed to the analyzer which generates tokens "cat" and "tiger", so the negation gets dropped.

Re: what's replacement of FieldCache in Lucene 7

2018-04-12 Thread Adrien Grand
Hello, Doc values should be used instead of the field cache indeed. Note that this require to add them to your documents at index time, eg. with a NumericDocValuesField. Regarding random access, maybe you can use the advanceExact API, which exists on all doc-value iterators. Just make sure to

what's replacement of FieldCache in Lucene 7

2018-04-12 Thread Yonghui Zhao
Hi, I am upgrading my project from Lucene 4 to 7. FieldCache is removed in lucene 7, DocValue is replacement? But seems DocValue doesn't support random access. I need random access to get some specified field value quickly. So how to solve it?

Re: analyzer context during search

2018-04-12 Thread Michael Sokolov
I think you can achieve what you are asking by having a field for every possible combination of pairs of input and output. Obviously this would explode the size of your index, so it's not ideal. Another alternative would be indexing all variants into a single field, using different analyzers for