mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
make id cache an index component, so a new instance will be created per index
This commit is contained in:
parent
1ee24ce60f
commit
bb0d7190e9
@ -21,6 +21,7 @@ package org.elasticsearch.index.cache.field.data;
|
||||
|
||||
import org.apache.lucene.index.IndexReader;
|
||||
import org.elasticsearch.common.component.CloseableComponent;
|
||||
import org.elasticsearch.index.IndexComponent;
|
||||
import org.elasticsearch.index.field.data.FieldData;
|
||||
import org.elasticsearch.index.field.data.FieldDataType;
|
||||
|
||||
@ -29,7 +30,7 @@ import java.io.IOException;
|
||||
/**
|
||||
* @author kimchy (shay.banon)
|
||||
*/
|
||||
public interface FieldDataCache extends CloseableComponent {
|
||||
public interface FieldDataCache extends IndexComponent, CloseableComponent {
|
||||
|
||||
FieldData cache(FieldDataType type, IndexReader reader, String fieldName) throws IOException;
|
||||
|
||||
|
@ -21,11 +21,12 @@ package org.elasticsearch.index.cache.id;
|
||||
|
||||
import org.apache.lucene.index.IndexReader;
|
||||
import org.elasticsearch.common.component.CloseableComponent;
|
||||
import org.elasticsearch.index.IndexComponent;
|
||||
|
||||
/**
|
||||
* @author kimchy (shay.banon)
|
||||
*/
|
||||
public interface IdCache extends CloseableComponent, Iterable<IdReaderCache> {
|
||||
public interface IdCache extends IndexComponent, CloseableComponent, Iterable<IdReaderCache> {
|
||||
|
||||
void clear();
|
||||
|
||||
|
@ -22,11 +22,12 @@ package org.elasticsearch.index.cache.query.parser;
|
||||
import org.apache.lucene.queryParser.QueryParserSettings;
|
||||
import org.apache.lucene.search.Query;
|
||||
import org.elasticsearch.common.component.CloseableComponent;
|
||||
import org.elasticsearch.index.IndexComponent;
|
||||
|
||||
/**
|
||||
* @author kimchy (shay.banon)
|
||||
*/
|
||||
public interface QueryParserCache extends CloseableComponent {
|
||||
public interface QueryParserCache extends IndexComponent, CloseableComponent {
|
||||
|
||||
Query get(QueryParserSettings queryString);
|
||||
|
||||
|
@ -23,14 +23,19 @@ import org.apache.lucene.queryParser.QueryParserSettings;
|
||||
import org.apache.lucene.search.Query;
|
||||
import org.elasticsearch.ElasticSearchException;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.index.AbstractIndexComponent;
|
||||
import org.elasticsearch.index.Index;
|
||||
import org.elasticsearch.index.cache.query.parser.QueryParserCache;
|
||||
import org.elasticsearch.index.settings.IndexSettings;
|
||||
|
||||
/**
|
||||
* @author kimchy (shay.banon)
|
||||
*/
|
||||
public class NoneQueryParserCache implements QueryParserCache {
|
||||
public class NoneQueryParserCache extends AbstractIndexComponent implements QueryParserCache {
|
||||
|
||||
@Inject public NoneQueryParserCache() {
|
||||
@Inject public NoneQueryParserCache(Index index, @IndexSettings Settings indexSettings) {
|
||||
super(index, indexSettings);
|
||||
}
|
||||
|
||||
@Override public Query get(QueryParserSettings queryString) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user