Commit Graph

1170 Commits

Author SHA1 Message Date
Igor Motov cfbd17992a lucene 4: convert script term to string 2012-11-12 13:44:41 +01:00
Igor Motov 74464f9f99 lucene 4: fix possible NPE in range queries and filters if one of the bounds is not specified 2012-11-12 13:44:41 +01:00
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
Igor Motov 5d7ef8f585 lucene4: fixed SortParseElement 2012-11-12 13:44:37 +01:00
Martijn van Groningen 1a46179c4e lucene 4: Upgraded AndFilter, FilteredCollector, LimitFilter, MatchAllDocsFilter and MatchNoDocsFilter. 2012-11-12 13:44:36 +01:00
Martijn van Groningen e75c732bdd lucene 4: Upgraded MatchNoDocsQuery. 2012-11-12 13:44:36 +01:00
Martijn van Groningen ddc3eb3415 lucene 4: Upgraded MultiPhrasePrefixQuery. 2012-11-12 13:44:36 +01:00
Martijn van Groningen da551e8847 lucene 4: Upgraded o.e.common.lucene.search.function package. 2012-11-12 13:44:36 +01:00
Igor Motov 6bbe37f876 lucene4: fixed integration tests that got broken by switch from String to Text in Facet terms 2012-11-12 13:44:36 +01:00
Igor Motov edb4fe18e0 lucene4: fixed index.merge.policy 2012-11-12 13:44:36 +01:00
Igor Motov f57efcf6c8 lucene4: finish org.elasticsearch.common.compress cleanup 2012-11-12 13:44:36 +01:00
Igor Motov 93906903b6 lucene4: switched setNextReader from IndexReader to AtomicReaderContext 2012-11-12 13:44:36 +01:00
Igor Motov 25d03a6a7d lucene4: upgraded ScoreDocQueue 2012-11-12 13:44:36 +01:00
Igor Motov 5cd9da4565 lucene4: fixed TransportNodesListShardStoreMetaData 2012-11-12 13:44:36 +01:00
Chris Male 27481800bc lucene 4: Upgraded FieldMapper.fuzzyQuery to use new FuzzyQuery API 2012-11-12 13:44:36 +01:00
Igor Motov be424c4564 lucene4: fixed SwitchDirectory and CompressedDirectory (except fileLength method) 2012-11-12 13:44:36 +01:00
Igor Motov e8092fe290 lucene4: org.apache.lucene.search.vectorhighlight package cleanup 2012-11-12 13:44:35 +01:00
Igor Motov 639b1323b8 lucene4: upgrade CustomMemoryIndex to Lucene 4 2012-11-12 13:44:35 +01:00
Martijn van Groningen 4178d48470 lucene 4: Fixed import issue. 2012-11-12 13:44:35 +01:00
Chris Male 724fadd2cd lucene 4: Converted Analyzers in MapperService 2012-11-12 13:44:35 +01:00
Martijn van Groningen 9f45b683d6 lucene 4: Fixed TERM_FACTORY usage in VersionFetchSubPhase class. 2012-11-12 13:44:35 +01:00
Martijn van Groningen 03a16ac7d8 lucene 4: Upgraded ContentIndexSearcher 2012-11-12 13:44:35 +01:00
Chris Male b3e59d58e4 lucene 4: Fixed TermFactory usage in MapperService 2012-11-12 13:44:35 +01:00
Martijn van Groningen 0354825914 lucene 4: Fixed compile error 2012-11-12 13:44:35 +01:00
Martijn van Groningen 083df0a86c lucene 4: Upgraded o.e.search.dfs package. #2 2012-11-12 13:44:35 +01:00
Martijn van Groningen 5f942ef63d lucene 4: Upgraded o.e.search.dfs package. (Distributed idf) 2012-11-12 13:44:35 +01:00
Igor Motov fd2cf776d8 lucene4: action package cleanup 2012-11-12 13:44:35 +01:00
Martijn van Groningen 3269e0c88e lucene 4: Fixed compile error 2012-11-12 13:44:35 +01:00
Martijn van Groningen fcc4fe263e lucene 4: Upgraded PercolatorExecutor 2012-11-12 13:44:34 +01:00
Simon Willnauer 22c14c7354 lucene 4: lucene package cleanups 2012-11-12 13:44:34 +01:00
Simon Willnauer 595acd695e lucene 4: s/reusableTokenStream/tokenStream 2012-11-12 13:44:34 +01:00
Martijn van Groningen d531fa7a46 lucene 4: Fixed compile error in FieldLookup 2012-11-12 13:44:34 +01:00
Martijn van Groningen 42a1d25064 lucene 4: Fixed last compile errors in HighlightPhase 2012-11-12 13:44:34 +01:00
Martijn van Groningen b928e74904 lucene 4: Moved from FieldSelectors to FieldVisitors. Removed BaseFieldVisitor#reset and changed SourceFieldVisitor and UidFieldVisitor to singleton to prototype. 2012-11-12 13:44:34 +01:00
Martijn van Groningen d8d7498292 lucene 4: Moved from FieldSelectors to FieldVisitors. 2012-11-12 13:44:34 +01:00
Simon Willnauer 77cbe0a26b lucene 4: s/getFieldable/getField 2012-11-12 13:44:34 +01:00
Simon Willnauer 0c1778a033 lucene 4: don't restrict ram buffer to 2GB this lucene restriction was removed with DWPT 2012-11-12 13:44:34 +01:00
Simon Willnauer d4e4b5d9f4 lucene 4: read commit user data from directory without a reader 2012-11-12 13:44:34 +01:00
Shay Banon 7b8ab2d685 lucene 4: cleanup unused class 2012-11-12 13:44:34 +01:00
Martijn van Groningen cdf1fc8981 lucene 4: upgraded o.e.index.search.nested package. Also fixed issue with liveDocs in child package. 2012-11-12 13:44:34 +01:00
Igor Motov a49078dfc1 lucene 4: replace UnicodeUtil.UTF8Result with BytesRef 2012-11-12 13:44:33 +01:00
Chris Male f444ed4dff lucene 4: Converted remaining Mappers to FieldType API 2012-11-12 13:44:33 +01:00
Chris Male 549900a082 lucene 4: Converted most Mappers over to FieldType API 2012-11-12 13:44:33 +01:00
Shay Banon e75301b781 lucene 4: optimize bytes on XContentParser
also, does not seem like we need to reuse bytes buffer, if we need to, we can always add it later
2012-11-12 13:44:33 +01:00
Martijn van Groningen 19ab1d0548 lucene 4: upgraded o.e.index.search.child package 2012-11-12 13:44:33 +01:00
Martijn van Groningen 71c3bd7c64 lucene 4: SearchContext#setNextReader accepts an AtomicReaderContext instead of an AtomicReader 2012-11-12 13:44:33 +01:00
Igor Motov 4e5e4869a6 lucene 4: add custom analyzer wrapper that supports overriding of getOffsetGap 2012-11-12 13:44:33 +01:00
Martijn van Groningen 24ef987624 lucene 4: Upgraded the simple id cache. 2012-11-12 13:44:33 +01:00
Simon Willnauer 683be6fc64 lucene 4: converted QueryParser/Builders to Lucene 4 2012-11-12 13:44:33 +01:00
Simon Willnauer 5bd8e1b337 lucene 4: fixed MLT query 2012-11-12 13:44:33 +01:00
Simon Willnauer ad84186509 lucene 4: fixed fuzzy like this queryparser/builder 2012-11-12 13:44:33 +01:00
Simon Willnauer c1a9c802f1 lucene 4: XContentParser now has bytesOrNull and returns bytesref directly 2012-11-12 13:44:33 +01:00
Simon Willnauer 479f1784e8 lucene 4: converted queryparser to lucene classic query parser 2012-11-12 13:44:32 +01:00
Simon Willnauer 5d47ad4648 lucene 4: upgraded FuzzyQueryParser + Builder to use integer edit distance rather
than floats (bw compatible)
2012-11-12 13:44:32 +01:00
Igor Motov b1eaec6c6a lucene 4: change Unicode utils to use BytesRef instead of UTF8Result 2012-11-12 13:44:32 +01:00
uboness c3633ab99f lucene 4: changed InternalIndexShard#checkIndex to use the new fixIndex and indexExists apis 2012-11-12 13:44:32 +01:00
Igor Motov 8009b80481 lucene 4: fix access to segment name due to SegmentInfo refactoring 2012-11-12 13:44:32 +01:00
Shay Banon 4b84078f91 lucene 4: text comparator should always work on bytes 2012-11-12 13:44:32 +01:00
Martijn van Groningen 65ce3aea57 lucene 4: Upgraded the function/sort classes. 2012-11-12 13:44:32 +01:00
Martijn van Groningen 48b8d0544f lucene 4: Moved SearchScript from IndexReader to AtomicReader. This also touches the seach/lookup classes 2012-11-12 13:44:32 +01:00
Martijn van Groningen d820bfe11b lucene 4: Changed from BytesReference to Text as internal term representation for facet keys. Text now also implements comparable. 2012-11-12 13:44:32 +01:00
Igor Motov b128b7a750 lucene 4: use CharArraySet for stem exclusions, stop words and articles and fix analyzer namespaces 2012-11-12 13:44:32 +01:00
Igor Motov 1cc5ee7ad9 lucene 4: implement createComponents in Analyzers 2012-11-12 13:44:32 +01:00
Igor Motov 6fad75df82 lucene 4: remove Pattern tokenizer and filter 2012-11-12 13:44:32 +01:00
Igor Motov 097cb2dac7 lucene 4: migrate char filter from CharStream to Reader 2012-11-12 13:44:31 +01:00
Shay Banon f572a7bcf7 lucene 4: no close on searcher anymore 2012-11-12 13:44:31 +01:00
Shay Banon ed03741353 lucene 4: hashCode and equals for Text and BytesReference
now that we are going to use those more in places like facets, they need to implement equals and hasCode to be used in hashes
2012-11-12 13:44:31 +01:00
Martijn van Groningen 15c9cd5142 lucene 4: Field name no longed interned when loading field data cache and return empty field data cache for fields that don't exist. 2012-11-12 13:44:31 +01:00
Martijn van Groningen 454954e7be lucene 4: Fix field data, facets and field comparators 2012-11-12 13:44:31 +01:00
Shay Banon 81d148b4e4 lucene 4: fix warmup process
also removed ExtendedIndexSearcher, we should do whats needed with the new context and leaves methods
2012-11-12 13:44:31 +01:00
Shay Banon 0c24928ef4 lucene 4: fix similarity packaging 2012-11-12 13:44:31 +01:00
Shay Banon f4418fb181 lucene 4: fix segments info usage 2012-11-12 13:44:31 +01:00
Shay Banon 7972f6f959 lucene 4: fix call to expungeDeletes 2012-11-12 13:44:31 +01:00
Shay Banon 386c2ebdb9 lucene 4: remove bloom cache
we can add bloom cache, if we need it, as a codec on the uid field
we still need to rewrite the UidFilter to not use bloom, but that will be the regular one
2012-11-12 13:44:31 +01:00
Igor Motov 05138bb2fb lucene 4: upgrade analyzers 2012-11-12 13:44:30 +01:00
Shay Banon 7aacc8d448 lucene 4: upgrade store/dir 2012-11-12 13:44:30 +01:00
Shay Banon 3d4ca81c29 remove XIndexWriter
removing the buffered deletes bloom filter no longer requires setting the bloom filter on it
2012-11-12 13:44:30 +01:00
Shay Banon f9b0fcb3a3 remove BufferedDeletesStream
by default, we will put a bloom filter code on the _uid field, so no need for the optimization of using bloom filters when trying to delete a doc by _uid term per segment
2012-11-12 13:44:30 +01:00
Shay Banon edaa65dba2 Multi Match: Wrongly defaults to dis_max instead of bool
fixes #2397
2012-11-10 14:59:45 +01:00
Njal Karevoll f33e353259 The index of the next RestFilter must be incremented before the current filter starts processing.
Otherwise, synchronous filters will not work. For example, the following filter would cause a StackOverflowError:

public class SimpleRestFilter extends RestFilter {
    @Override
    public void process(RestRequest request, RestChannel channel, RestFilterChain filterChain) {
        filterChain.continueProcessing(request, channel);
    }
}
2012-11-09 22:04:09 +01:00
Shay Banon a8e43578a2 Adding a type with _source or _all enabled fails, when these are disabled in index
fixes #2394
2012-11-09 17:21:25 +01:00
Martijn van Groningen 4a9faac470 Added must/should/mustNot method variants that accepts vararg FilterBuilder instances. 2012-11-06 14:23:03 +01:00
Shay Banon 31a8e92b8e Node Stats: add max content length to http info 2012-11-06 11:37:23 +01:00
Shay Banon 0d5530e55f Node Stats: add available processors to OS info 2012-11-06 11:31:23 +01:00
Shay Banon 33900476f4 Node Stats: Add largest thread pool count per thread pool stats
closes #2382
2012-11-06 11:25:38 +01:00
Igor Motov af1e8c0eb1 Add auto index creation on update request
Fixes #2375
2012-11-02 10:18:51 -04:00
Martijn van Groningen ef25ac2414 Fixed that the `ignore_indices` option isn't set in multi search api. Closes #2380 2012-11-02 10:58:02 +01:00
Aaron Dixon bd9a5bfa0c fixed issue2371 (incorrect behavior of path_match) 2012-11-01 22:11:33 +01:00
Chris Male 768b8b4d2b Changed SpatialRelation contains to within 2012-11-01 22:03:47 +01:00
Igor Motov 23f7b0002a Deleting a non-existent warmer shouldn't cause request to hang
Fixes #2363
2012-11-01 21:49:54 +01:00
Igor Motov 7aa3f51b6e Simplify plugin installation troubleshooting
Add check for write access to plugins directory before trying to install plugin. Support verbose mode that prints out intermediate exceptions. Don't install plugin is plugin directory already exists. Fixes #2357
2012-11-01 21:47:15 +01:00
Igor Motov a2628b5eb2 Upsert should return fields Fixes #2362 2012-11-01 21:43:23 +01:00
Shay Banon d8013aecc3 add 0.19.11 and 0.19.12 versions 2012-10-24 01:41:46 +02:00
Igor Motov 29928a9e15 Add test for percolation with the _size field enabled 2012-10-23 23:08:52 +02:00
Igor Motov a760f906e5 Percolation shouldn't fail when the _size field is enabled 2012-10-23 23:08:52 +02:00
Shay Banon 227250aaa0 add fvh and plain shortcuts for highlighter types 2012-10-23 02:28:17 +02:00
Igor Motov c551f93cae Add highlighter type switch 2012-10-23 02:25:55 +02:00
Shay Banon 4573abc737 nested facet fails with filter caching turned off
fixed #2340
2012-10-22 20:04:57 +02:00
Shay Banon 04eabbd38a Mapping: string mapping to automatically set omit_norms to true and index_options to docs when setting index to not_analyzed
closes #2349
2012-10-22 19:01:01 +02:00
Shay Banon e40f4d2b1a add cluster name back to cluster state API 2012-10-22 15:35:04 +02:00
Shay Banon a3ffc65909 add 0.20.0.RC2 to versions on master 2012-10-22 01:56:23 +02:00
Shay Banon c1489be816 forgot to mark 0.21.0 as snap 2012-10-22 01:55:33 +02:00
Shay Banon 6ec0071fa4 move master to be 0.21.0 Beta1 snap 2012-10-22 01:51:20 +02:00
Shay Banon fe980343be release 0.20.0.RC1 2012-10-22 01:48:09 +02:00
Shay Banon c0e2eb5f5f better workaround for snappy error output
instead of setting the err stream to null, set it to a null output print stream
2012-10-22 00:15:12 +02:00
Shay Banon faa7501715 Aliases API times out when actions end up with no actual change to aliases
closes #2345
2012-10-21 02:45:56 +02:00
Shay Banon a3e7daf415 Auto create index to support white/black lists of index patterns
closes #2344
2012-10-21 02:27:30 +02:00
Martijn van Groningen 6a936a9efc Added method that accepts a map as script parameters 2012-10-21 00:46:19 +02:00
Martijn van Groningen ee5df74a6b Fixed delete by query issue with index aliases and nested mappings.
The issue was that under these circumstances the delete by query operation would run forever.
What also is fixed is that during shard recovery when delete by query is replayed nested docs
are also deleted. Closes #2302
2012-10-20 23:39:15 +02:00
Shay Banon 246dc1d992 formatting 2012-10-19 09:48:48 +02:00
Simon Willnauer b6a83fd8b2 #2332 support CustomScoreQuery highlighting and expose QueryBuilder on CustomScoreQuery via Java API 2012-10-19 09:23:16 +02:00
Shay Banon 2c7850584d move all allocations to be Decision base
this again will allow to provide better output as to why a specific decision has been made (like a shard needing to move from a node)
2012-10-16 10:10:06 -04:00
Shay Banon a963bc1dc9 Setting index_analyzer incorrectly sets analyzer
fixes #2329
2012-10-16 09:19:47 -04:00
Shay Banon c2073c343d improve allocation decision to allow to explain why a decision has been made
building the infra to support explaining why an allocation decision has been made, for example, why a shard is not allocated on a specific node
2012-10-16 09:03:54 -04:00
Shay Banon 384286d463 Mapping: Using _default_ mapping type with _source excludes (or array based config) can cause the array to grow indefinitely
closes #2317
2012-10-11 19:02:06 -07:00
Shay Banon 27562270ca simplify cleaning up non allocation shard code
its pretty complex today, simplify it by doing a single iteration, and handling both dangling shard cleanup on existing indices and shards that have been reallocated to a differetn node
2012-10-11 18:46:24 -07:00
Shay Banon 320c9b7681 close parser when parsing update body 2012-10-06 19:47:11 +02:00
Shay Banon 2fa017db11 Terms filter: Add `or` and `or_nocache` execution modes
closes #2306
2012-10-05 18:21:58 +02:00
Shay Banon 9122befdfb add logging on the size of message received 2012-10-04 20:33:25 +02:00
Shay Banon 8ea019aa82 formatting 2012-10-04 20:07:57 +02:00
Henrik Lindström 4d969add80 If types and index mappings are empty consider the mapping as an "empty" mapping and return status 200. 2012-10-04 20:07:10 +02:00
Shay Banon 2c150419ce add additional (internal) flush option
this flush option allows to just commit and index writer, without actually clearing the translog
2012-10-03 16:36:13 -04:00
Shay Banon 2532761c51 increase the clean interval of filter cache 2012-10-01 15:30:14 -04:00
Shay Banon 9096baf7d9 1.7 compiler failure
fixes #2294.
2012-10-01 08:11:28 -04:00
Shay Banon 9ad8c08505 fix segments per tier to the proper 10 default 2012-09-30 10:12:03 -04:00
Shay Banon 433b189eb4 provide the timer for netty
this helps to control the thread name of the thread it created
2012-09-30 09:11:03 -04:00
Shay Banon 05653cbdaa move cleaning filter cache on closed readers to separate thread
improve cleaning the global weighted cache when a reader closes, move it to a separate thread, so iterating over the cache entries will nto happen on each segment closed, but instead be "bulked"
2012-09-29 14:06:28 +02:00
Shay Banon 9dd8e1ea05 refresh thread pool to use scaling with default size of 10 2012-09-29 13:21:18 +02:00
Shay Banon 5bf566660b fix detection when JTS / spatial4j are not available 2012-09-28 22:29:08 +02:00
Shay Banon 7d6c567e6f return null instead of empty doc set
null can more easily be optimized in other filters
2012-09-28 17:18:07 +02:00
Martijn van Groningen 51e69e1a9e Fixed NPE when using `has_parent` or `has_child` filter/query.
The NPE occurred when for an arbitrary segment no parent documents exist for a has_parent filter/query and no child documents exist for a has_child filter/query.

Closes #2297
2012-09-28 17:08:30 +02:00
Shay Banon 2df6b4b0ea more guice to use Objects from guava 2012-09-28 14:03:41 +02:00
Shay Banon f9fc9bdb20 query_string on multiple fields with "*" fails in 0.19.9
fixed #2296
2012-09-28 14:00:43 +02:00
Shay Banon d8a3096a1a make sure to pass the updated settings from the plugins to the modules with transport client 2012-09-28 13:47:34 +02:00
Shay Banon 613c70c289 introduce TransportResponse
a class that needs to be used when sending a response over the transport layer, with an option to have headers
2012-09-27 18:05:16 +02:00
Shay Banon 15453272f7 fetching a shape should not occur on separate thread 2012-09-26 23:47:27 +02:00
Shay Banon cfe7504d1c introduce TransportRequest (with optional headers)
introduce a new class, TransportRequest, which includes headers. This class can be used when sending requests over the transport layer, and ActionRequest also extends it now.
This is the first phase of the refactoring part in the transport layer and action layer to allow for simpler implementations of those as well as simpler "filtering" capabilities in the future
2012-09-26 23:46:28 +02:00
Shay Banon 15fbbd43ce Bulk Delete item when broadcast to all shard (lack of routing) might not be applied correctly
closes #2285.
2012-09-24 14:04:10 +02:00
Martijn van Groningen 81a6940ad3 Fixed score explain is for `custom_filters_score` query.
Only the explain of the filter was included. This fix adds an explain for the inner query and wraps it in a top-level explanation.
2012-09-24 14:00:34 +02:00
Shay Banon 6e66f45f58 minor geo shape fetch improvements 2012-09-23 21:31:13 +02:00
Chris Male 05e0b4d4e0 Added ShapeFetchService with support in GeoShapeQueryParser/FilterParser 2012-09-23 21:24:13 +02:00
Shay Banon df0ff176d4 add simpler way to set the epoll bug workaround flag for netty 2012-09-22 19:50:43 +02:00
Shay Banon f73d684c76 use the version to deserialize published cluster state 2012-09-22 19:47:50 +02:00
Shay Banon d5e11fdcd9 disconnect from unicast nodes before raising event 2012-09-22 19:38:34 +02:00
Shay Banon aa435a288b add node version to each request/response transport message
a version associated with each request, and having it associated with the stream when (de)serializing, can allow us in the future to better support cross version communication
2012-09-22 02:35:29 +02:00
Shay Banon cc7eb263be Transport: Add header token
This allows to more easily identify when illegal content is being sent to the transport port
closes #2280
2012-09-21 23:56:27 +02:00
Shay Banon a3af3d2f47 Norms field is ignored when doing a match_all query
we shouldn't optimize a match all query if it has norms associated with it, fixes #2277
2012-09-21 18:57:21 +02:00
Chris Male 4f5e62e988 Added MultiPolygon parsing and serialization support 2012-09-21 14:03:21 +02:00
Martijn van Groningen 8080fdc509 Added types exists api
The types exists api checks whether one or more types exists in one or more indices.

## Example usage
curl -XHEAD 'localhost:9200/twitter/tweet'

## Options
* `index` - One or more indices. Either specified as query string parameter or in the uri path.
* `type` - One or more types. Either specified as query string parameter or in the uri path.
* `ignore_missing` -  Determines what type of indices to exclude from a request. The option can have the following values: `none` or `missing`.

Closes #2273
2012-09-21 10:21:32 +02:00
Chris Male 6fc0b83e07 Upgraded to Spatial4j 0.3 2012-09-20 23:55:51 +02:00
Shay Banon 0fadbf2177 more easily add a field with boost to multi match builder 2012-09-20 12:38:13 +02:00
Shay Banon 83a39bd509 improve test by not waiting for green state, no need 2012-09-20 12:00:58 +02:00
Shay Banon f8e1291243 global node indices level queries to be created by guice 2012-09-20 11:54:46 +02:00
Shay Banon 4e19de1a08 don't serialize ignore_unmapped to mapping on default value
fix ignore_unmapped being serialized as part of the mappings even though it has a default value and not explicitly set
2012-09-19 20:54:13 +02:00
Shay Banon 7f6f001d15 better reason logged when not master 2012-09-19 18:28:29 +02:00
Martijn van Groningen afc99ac42c Added id cache size to nodes stats api
Also added bloom cache size the node *rest* api
Closes #2264
2012-09-19 13:16:24 +02:00
Shay Banon 86e88a86b8 expose the highlighter builder Field constructor 2012-09-19 11:47:48 +02:00
Martijn van Groningen d5aa35e0ea Added better error handling for has_child, has_parent and top_children.
If has_parent, has_child or top_children are executed incorrectly then a better exception is thrown. This gives a better error description when one of these queries or filters is being used in count api.

Closes #2261
2012-09-18 13:26:23 +02:00
Shay Banon 7924115b90 Disable allocation: New indices allocation not to be disabled by default
When setting cluster.routing.allocation.disable_allocation, it causes new indices primary shards to not be allocated. By default, new indices created should allow to, at the very least, allocate primary shards so they become operations. A new setting, cluster.routing.allocation.disable_new_allocation, allows to also disable "new" allocations.
closes #2258.
2012-09-17 16:00:55 +02:00
Shay Banon 90e0a70e0e cancel allocation command to allow_primary to be cancelled 2012-09-17 12:31:33 +02:00
Martijn van Groningen 42864f7481 Fixed wrong jdoc 2012-09-17 12:00:44 +02:00
Shay Banon afca5ef15f The reroute command allows to explcitiyly execute a cluster reroute allocation command including specific commands. For example, a shard can be moved from one node to another explicitly, an allocation can be canceled, or an unassigned shard can be explicitly allocated on a specific node.
Here is a short example of how a simple reroute API call:

    curl -XPOST 'localhost:9200/_cluster/reroute' -d '{
        "commands" : [
            {"move" : {"index" : "test", "shard" : 0, "from_node" : "node1", "to_node" : "node2"}},
            {"allocate" : {"index" : "test", "shard" : 1, "node" : "node3"}}
        ]
    }'

An importnat aspect to remember is the fact that once when an allocation occurs, the cluster will aim at rebalancing its state back to an even state. For example, if the allocation includes moving a shard from `node1` to `node2`, in an "even" state, then another shard will be moved from `node2` to `node1` to even things out.

The cluster can be set to disable allocations, which means that only the explicitl allocations will be performed. Obviously, only once all commands has been applied, the cluster will aim to be rebalance its state.

Anohter option is to run the commands in "dry_run" (as a URI flag, or in the request body). This will cause the commands to apply to the current cluster state, and reutrn the resulting cluster after the comamnds (and rebalancing) has been applied.

The commands supporterd are:

* `move`: Move a started shard from one node to anotehr node. Accepts `index` and `shard` for index name and shard number, `from_node` for the node to move the shard "from", and `to_node` for the node to move the shard to.
* `cancel`: Cancel allocation of a shard (or recovery). Accepts `index` and `shard` for index name and shar number, and `node` for the node to cancel the shard allocation on.
* `allocate`: Allocate an unassigned shard to a node. Accepts the `index` and `shard` for index name and shard number, and `node` to allocate the shard to. It also accepts `allow_primary` flag to explciitly specify that it is allowed to explciitly allocate a primary shard (might result in data loss).

closes #2256
2012-09-15 22:56:14 +02:00
Martijn van Groningen 9c04e6a4f4 Clean up has_parent query code Renamed some exception messages and removed method from builder 2012-09-14 19:06:12 +02:00
Martijn van Groningen cfe76546f2 Added has_parent query The `has_parent` query works the same as the `has_parent` filter, by automatically wrapping the filter with a constant_score. It has the same syntax as the `has_parent` filter. Closes #2254 2012-09-14 17:34:01 +02:00
Shay Banon 7bf233a174 fix cleanup of of has child/parent
check if the collected uids were processed before trying to push them back to the cache
2012-09-14 15:01:21 +02:00
Martijn van Groningen 3cd54fc4ee Improve `has_child` filter / query performance (#2251) Added a new has_child filter implementation, that works _uid based instead of bitset based. This implementation is about ~2 till ~6 times (depending on the query) faster than the already existing bitset based implementation. 2012-09-14 14:37:29 +02:00
Shay Banon 4dddeeb30c When configuring mmapfs it is not used since 0.19.7, closes #2253. 2012-09-14 14:30:44 +02:00
Shay Banon ef9974ce2c add serialization options for allocation commands 2012-09-14 14:26:39 +02:00
Martijn van Groningen 2bd9b3aed0 Added `has_parent` filter (#2243)
The `has_parent` filter accepts a query and a parent type. The query is executed in the parent document space, which is specified by the parent type. This filter return child documents which associated parents have matched. For the rest `has_parent` filter has the same options and works in the same manner as the `has_child` filter.

This is an experimental filter.

Filter example
###################
```
{
    "has_parent" : {
        "parent_type" : "blog"
        "query" : {
            "term" : {
                "tag" : "something"
            }
        }
    }
}
```
The `parent_type` field name can also be abbreviated to `type`.

Memory considerations
###############
With the current implementation, all _id values are loaded to memory (heap) in order to support fast lookups, so make sure there is enough mem for it.

This issue originates from issue #792
2012-09-13 13:35:45 +02:00
Shay Banon e530f03b94 internal custom allocation commands
add support for internal custom allocation commands, including allocation, move, and cancel (shard).
also, fix #2242, which causes the cluster state to be in inconsistent state when a shard being the source of relocation is failed
2012-09-12 15:13:27 +02:00
Martijn van Groningen b6a9bd9a31 - Fixed boosting per field with multi_match query. 2012-09-12 11:43:33 +02:00
Shay Banon fbd352b448 sync with latest guava version of abstract future 2012-09-07 11:13:43 +02:00
Shay Banon 8038616fbc add field with text/bytes and builder string 2012-09-06 20:47:13 +02:00
Shay Banon b26fd600f0 allow to configure cors on http
Allow to configure cors on http, if its enabled or not, and what it should output
2012-09-06 20:35:36 +02:00
Karel Minarik f659cad8d6 Added proper headers for cross-origin resource sharing (CORS) with Ajax
Previously, when responding to Ajax requests, elasticsearch did not send proper headers for
cross-origin resource sharing (CORS) -- see issues #828, #2186.

With this commit, Ajax requests should be working. Example:

    jQuery.ajax({
      url: "http://localhost:9200/_search",
      type: "POST",
      contentType: 'application/json; charset=UTF-8',
      success: function(data) { console.log(data) }
    });

See:

* http://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin-resource-sharing/
* http://www.w3.org/TR/cors/#access-control-allow-headers-response-header

Closes #2186, fixes #828
2012-09-06 17:14:55 +02:00
Shay Banon f2db8eaca2 IndexMetaData.Builder.Index(String name) isn't renaming this.index
fixed #2236.
2012-09-06 16:30:05 +02:00
Martijn van Groningen 33e7d769ca Fixed no valid missing index type error. 2012-09-05 19:20:53 +02:00
Shay Banon 24ce2ef537 handle EOF when handling arrays as well 2012-09-05 11:40:39 +02:00
Henrik Lindström 26feea8a58 Throw MapperParserException if trying to parse value as object. 2012-09-04 16:12:02 +02:00
Shay Banon 92dfb2b809 Nodes level API: Allow to specify `data:true` to only execute the APIs on data nodes, closes #2232 2012-09-04 00:03:06 +02:00
Shay Banon 0de8c06900 fix logging if millisecond value in load field data 2012-09-03 23:53:50 +02:00
Shay Banon a42159f8d5 Shard Allocation: `index.routing.allocation....` settings do not "remove" the setting on empty string, closes #2229. 2012-09-03 16:44:23 +02:00
Shay Banon edfbfc1c87 Update Settings API: Allow body request to be wrapped with `settings` element to conform with other APIs, closes #2227. 2012-09-02 17:40:08 +02:00
Shay Banon 6c3847b0a9 move spatial4j and jts to be optional dependencies
allowing data and client nodes to work without them, disabling shapes if needed
2012-09-01 00:05:49 +02:00
Kenn Knowles e66bd4359a Fix reversed ShingleFilter constructor arguments 2012-08-31 22:25:07 +02:00
Martijn van Groningen 9b29950997 Added fields option to explain api. #2203 2012-08-31 22:19:09 +02:00
Martijn van Groningen cd0e1226e1 Added a global ignore_malformed index setting. #2220 Also extended the ignore_malformed support to TTL, Ip and timestamp field types. 2012-08-31 22:10:46 +02:00
Shay Banon 888b7cc48f only print failure to reconnect to node from other nodes after several retries 2012-08-31 17:14:04 +02:00
Martijn van Groningen dea2de3304 Add ignore_indices option for search, multisearch, count and other Broadcast request. #2209 2012-08-27 15:36:14 +03:00
Martijn van Groningen 1d4aee6086 - Explain api opens 2 engine searchers, but closes only 1 engine searcher. Closes #2206 2012-08-27 12:20:02 +03:00
Shay Banon da61ddee3c 0.19.9 no longer supports /_all/_status, closes #2205. 2012-08-25 14:18:48 +03:00
Shay Banon dfa67bf071 allow to register custom state associated with cluster state 2012-08-25 00:40:44 +03:00
Martijn van Groningen bbe735f2cc Fixed issue #2197 2012-08-25 00:38:26 +03:00
uboness b4b33bb205 Local node master listener
* Fixed an issue where dynamic update to minimum_master_nodes settings would not take immediate effect
* Added LocalNodeMasterListener support to the ClusterService. Enables listening to when the local node becomes/stopped being a master
2012-08-24 02:25:13 +02:00
Shay Banon 36ff6c9b8b add a lock not allowing connecting to nodes while shutting down 2012-08-24 02:23:43 +02:00
Shay Banon 333293babd ignore cancelled key exception as well 2012-08-23 23:35:48 +02:00
Shay Banon 072fcaa760 Bulk UDP, closes #2201
A Bulk UDP service is a service listening over UDP for bulk format requests. The idea is to provide a low latency UDP service that allows to easily index data that is not of critical nature.

The Bulk UDP service is disabled by default, but can be enabled by setting `bulk.udp.enabled` to `true`.

The bulk UDP service performs intenral bulk aggregation of the data and then flushes it based on several parametres:

* `bulk.udp.bulk_actions`: The number of actions to flush a bulk after, defaults to `1000`.
* `bulk.udp.bulk_size`: The size of the current bulk request to flush the request once exceeded, defaults to `5mb`.
* `bulk.udp.flush_interval`: An interval after which the current request is flushed, regarldess of the above limits. Defaults to `5s`.
* `bulk.udp.concurrent_requests`: The number on max in flight bulk requests allowed. Defaults to `4`.

The network settings allowed are:

* `bulk.udp.host`: The host to bind to, defualts to `network.host` which defaults to any.
* `bulk.udp.port`: The port to use, defaults to `9700-9800`.

Here is an example of how it can be used:

    > cat bulk.txt
    { "index" : { "_index" : "test", "_type" : "type1" } }
    { "field1" : "value1" }
    { "index" : { "_index" : "test", "_type" : "type1" } }
    { "field1" : "value1" }

    > cat bulk.txt | nc -w 0 -u localhost 9700
2012-08-23 22:17:37 +02:00
Shay Banon ba98b04081 fix wrong check on close 2012-08-23 20:58:40 +02:00
Shay Banon bb609f696f add 0.19.10 2012-08-23 13:52:57 +02:00
Shay Banon 1f3b0d4144 Reduce index.shard.recovery.concurrent_streams from 5 to 3 to reduce the load when doing recovery, closes #2199.
the index.shard.recovery.concurrent_streams controls how many streams are opened from a recovery source to a recovery target to transfer index files. Reduce it from 5 to 3 to reduce the load when doing recovery (for example, due to relocation).

Note, recent changes in network buffering will mean that recovery will progress considerably faster, so this change will not affect recovery times.
2012-08-23 13:20:54 +02:00
Shay Banon 37b33cf77d protect a bit more from bogus (not relevant) exceptions when closing a node 2012-08-23 01:31:11 +02:00