Commit Graph

4350 Commits

Author SHA1 Message Date
Igor Motov 6d40770200 lucene 4: fixed facets and filtering aliases
I am not completely sure about this one, but it reduces the number of failing tests from 98 to 31 so I am going to check it in. Please, review and fix it, if there is a better solution.

Because of change in Lucene 4.0, ContextIndexSearcher was bypassed and elasticsearch filters and collectors were ignored.

In lucene 3.6 the stack of Searcher search calls looked like this:
search(Query query, int n)
search(Query query, Filter filter, int n)
search(Weight weight, Filter filter, int nDocs)
search(Weight weight, Filter filter, ScoreDoc after, int nDocs)
search(Weight weight, Filter filter, Collector collector) <-- this is ContextIndexSearcher was injecting combined filter and collector
search(Weight weight, Filter filter, Collector collector)

In Lucene 4.0 the stack looks like this:
search(Query query, int n)
search(Query query, Filter filter, int n) <-- here lucene wraps Query and Filter into Weight
search(Weight weight, ScoreDoc after, int nDocs)
search(List<AtomicReaderContext> leaves, Weight weight, ScoreDoc after, int nDocs)
search(List<AtomicReaderContext> leaves, Weight weight, Collector collector)
...

In other words, when we have Filter, we don't have a Collector yet, but when we have Collector, Filter is already wrapped inside Weight.  The only way to fix for the problem that I could think of is by introducing two injection points: one for Filters and another one for Collectors:

search(Query query, int n)
search(Query query, Filter filter, int n) <-- here combined Filters are injected
search(Weight weight, ScoreDoc after, int nDocs)
search(List<AtomicReaderContext> leaves, Weight weight, ScoreDoc after, int nDocs)
search(List<AtomicReaderContext> leaves, Weight weight, Collector collector) <-- here Collectors are injected

Similar problem existed for count(), so I had to override search(Query query, Collector results) as well.
2012-11-12 13:44:41 +01:00
Igor Motov 2eaad61a9e lucene4: make SimpleIdCache more resilient to missing fields
Not sure if we can get a segment with the _uid field, but segments without the _parent field definitely happen.
2012-11-12 13:44:41 +01:00
Igor Motov 9ad05ecdea lucene 4: make FieldVistors behave similar to FieldSelectors
Added back reset() method for now to make things work. Will refactor it out when we have tests passing.
2012-11-12 13:44:41 +01:00
Igor Motov 7aac88cf5c lucene4: check liveDocs and acceptedDocs for null before trying to call get() on them 2012-11-12 13:44:40 +01:00
Igor Motov 3f3a95668b lucene4: add support for omit_norm setting to numeric types and don't omit norms if boost is not 1.0
This commit enables setting boost for numeric fields. However, there is still no way to take advantage of boosted numeric fields during searching because all queries against numeric fields are translated into range queries wrapped in ConstantScore. Boost for numeric fields is broken on master as well https://gist.github.com/7ecedea4f6a5219efb89
2012-11-12 13:44:40 +01:00
Igor Motov 2fb3591792 lucene4: fixed default values tests to refer to correct default FieldType constants 2012-11-12 13:44:40 +01:00
Igor Motov a5bef30be9 lucene4: fixed CompressIndexInputOutputTests 2012-11-12 13:44:40 +01:00
Igor Motov 3816366780 lucene4: fixed SimpleAllMapperTests 2012-11-12 13:44:40 +01:00
Shay Banon 25717ab253 lucene 4: only omit_norms on non analyzed field if boost is not set 2012-11-12 13:44:40 +01:00
Shay Banon 72f41111c9 lucene 4: calling tokenStream is enough, verified to return a stream to analyze content 2012-11-12 13:44:40 +01:00
Shay Banon cb5df26bf7 lucene 4: use the proper token stream to return 2012-11-12 13:44:40 +01:00
Shay Banon a10f60873c lucene 4: fix numeric types to properly return numeric streams 2012-11-12 13:44:40 +01:00
Shay Banon a38064913f lucene 4: fix engine tests 2012-11-12 13:44:40 +01:00
Shay Banon 53d9b13e2f lucene 4: fix optimization check to set docs_only+omit_norms 2012-11-12 13:44:40 +01:00
Igor Motov 8a34ea1223 lucene4: fixed FloatFieldDataTests 2012-11-12 13:44:40 +01:00
Igor Motov bf13f3f81e lucene4: fixed SimpleIndexQueryParserTests 2012-11-12 13:44:39 +01:00
Martijn van Groningen db639e5c2e lucene 4: Upgraded SimpleLuceneTests class. Test actually passes now. 2012-11-12 13:44:39 +01:00
Martijn van Groningen 2a8161d096 lucene 4: Upgraded SimpleLuceneTests class.
The complete codebase compiles now!
2012-11-12 13:44:39 +01:00
Martijn van Groningen aa2a8c66cc lucene 4: Upgraded UidFieldTests class. 2012-11-12 13:44:39 +01:00
Shay Banon f796fe8d5e lucene 4: fix cases where number values are not stored 2012-11-12 13:44:39 +01:00
Martijn van Groningen 5c0ef796e8 lucene 4: Upgraded BoostMappingTests + SimpleMapperTests 2012-11-12 13:44:39 +01:00
Shay Banon cefe2ba870 lucene 4: fix fuzzy query test 2012-11-12 13:44:39 +01:00
Shay Banon bec0ffa623 lucene 4: make sure to apply doc boost only once per field name 2012-11-12 13:44:39 +01:00
Shay Banon 7ecfa9c35f lucene 4: caching should pass acceptDocs
still work left on streamlining filters
2012-11-12 13:44:39 +01:00
Shay Banon c60f20413b lucene 4: support doc level boost 2012-11-12 13:44:39 +01:00
Shay Banon b492320e2f lucene 4: switch directory not used 2012-11-12 13:44:39 +01:00
Shay Banon dca88a9b7c lucene 4: use field type in UidField 2012-11-12 13:44:39 +01:00
Shay Banon faf3e0e857 lucene 4: comment on adding DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS 2012-11-12 13:44:38 +01:00
Shay Banon e9f8d0c722 lucene 4: extrace Lucene#readSegmentsInfo, and use it where applicable 2012-11-12 13:44:38 +01:00
Shay Banon 0660e20c47 lucene 4: cleanup terms/uid filter 2012-11-12 13:44:38 +01:00
Shay Banon 79368bb221 lucene 4: fix visitors to use constants for field names 2012-11-12 13:44:38 +01:00
Martijn van Groningen 6ca6407468 lucene 4: Re-fixed issue in SourceScoreOrderFragmentsBuilder and SourceSimpleFragmentsBuilder. 2012-11-12 13:44:38 +01:00
Simon Willnauer a3de9e521d lucene 4: replaced TrimFilter and WordDelimiterFilter with lucene versions 2012-11-12 13:44:38 +01:00
Martijn van Groningen e33ae96b38 lucene 4: added overloaded method. To fix issue in SourceScoreOrderFragmentsBuilder and SourceSimpleFragmentsBuilder. 2012-11-12 13:44:38 +01:00
Martijn van Groningen 38dc19d8bc lucene 4: Fixed compile error. 2012-11-12 13:44:38 +01:00
Martijn van Groningen 673712c0b2 lucene 4: Upgraded IndexedGeoBoundingBoxFilter & InMemoryGeoBoundingBoxFilter. 2012-11-12 13:44:38 +01:00
Martijn van Groningen d42d153c48 lucene 4: Upgraded GeoDistanceRangeFilter, GeoPolygonFilter. 2012-11-12 13:44:38 +01:00
Martijn van Groningen 415cfa2e89 lucene 4: Upgraded GeoDistanceFilter, MatchedFiltersFetchSubPhase. 2012-11-12 13:44:38 +01:00
Martijn van Groningen ba1b870580 lucene 4: Upgraded CacheKeyFilter. 2012-11-12 13:44:38 +01:00
Martijn van Groningen 3298ad2235 lucene 4: Upgraded UidField. (version can be stored later as doc values) 2012-11-12 13:44:37 +01:00
Martijn van Groningen 968b012911 lucene 4: Upgraded *ValueGeoPointFieldData and GeoDistanceDataComparator. 2012-11-12 13:44:37 +01:00
Martijn van Groningen 09fe15488d lucene 4: Upgraded ScanContext. 2012-11-12 13:44:37 +01:00
Igor Motov 41325113f0 lucene4: switched from Field.Index to boolean indexed in ParseContext.includeInAll() 2012-11-12 13:44:37 +01:00
Igor Motov daf347e67e lucene4: replace IndexCommit.getVersion() with IndexCommit.getGeneration() 2012-11-12 13:44:37 +01:00
Igor Motov 787b7a3900 lucene4: more unit test cleanup 2012-11-12 13:44:37 +01:00
Igor Motov 5ad40205c2 lucene4: remove DocumentBuilder and FieldBuilder 2012-11-12 13:44:37 +01:00
Shay Banon 594598f493 close the index input in any case when computing length 2012-11-12 13:44:37 +01:00
Igor Motov bb76542068 lucene4: unit tests cleanup 2012-11-12 13:44:37 +01:00
Martijn van Groningen 5a553a1924 lucene 4: Upgraded AndFilter, NotDeletedFilter, NotFilter, OrFilter, TermFilter, XBooleanFilter. Left a live docs and accepted docs unhandled (used null) for. I added a note at all places. 2012-11-12 13:44:37 +01:00
Igor Motov 6b4e483f55 lucene4: fixed unit.index.mapper, unit.index.query and unit.index.store test (with exception of document boost and similarity issues) 2012-11-12 13:44:37 +01:00