public class IndexFacts extends Object
IndexFacts.Session session = indexFacts.newSession(query); // once when starting to process a query
session.getIndex(indexName).[get index info]
Modifier and Type | Class and Description |
---|---|
private static class |
IndexFacts.DocumentTypeListOffset |
class |
IndexFacts.Session
Create an instance of this to look up index facts with a given query.
|
Modifier and Type | Field and Description |
---|---|
private Map<String,List<String>> |
clusterByDocument |
private Map<String,List<String>> |
clusters
A map of document types contained in each cluster indexed by cluster name
|
private boolean |
frozen |
private boolean |
hasNGramIndices
Whether this has (any) NGram indexes.
|
private Map<String,SearchDefinition> |
searchDefinitions
A Map of all known search definitions indexed by name
|
static String |
unionName
Deprecated.
do not use
|
private SearchDefinition |
unionSearchDefinition
A search definition which contains the union of all settings.
|
Constructor and Description |
---|
IndexFacts() |
IndexFacts(IndexModel indexModel) |
Modifier and Type | Method and Description |
---|---|
private static void |
addEntry(Map<String,List<String>> result,
String key,
String value) |
void |
addIndex(String sdName,
Index index)
Deprecated.
set indexes at creation time instead
|
void |
addIndex(String sdName,
String indexName)
Deprecated.
set indexes at creation time instead
|
private IndexFacts.DocumentTypeListOffset |
chooseSearchDefinition(List<String> documentTypes,
int index)
Chooses the correct search definition, default if in doubt.
|
List<String> |
clustersHavingSearchDefinition(String searchDefinitionName) |
private Collection<String> |
emptyCollectionIfNull(Collection<String> collection) |
private void |
ensureNotFrozen() |
void |
freeze()
Freeze this to prevent further changes.
|
private String |
getCanonicNameFromDocumentTypes(String indexName,
List<String> documentTypes) |
String |
getDefaultPosition(String sdName) |
private Index |
getIndexByCanonicNameFromDocumentTypes(String canonicName,
List<String> documentTypes) |
private Collection<Index> |
getIndexes(String documentType) |
private Index |
getIndexFromDocumentTypes(String indexName,
List<String> documentTypes) |
boolean |
hasNGramIndices()
Whether this contains any index which has isNGram()==true.
|
private static Map<String,List<String>> |
invert(Map<String,List<String>> clusters) |
boolean |
isFrozen() |
private boolean |
isIndexFromDocumentTypes(String indexName,
List<String> documentTypes) |
private boolean |
isInitialized() |
IndexFacts.Session |
newSession(Collection<String> sources,
Collection<String> restrict) |
IndexFacts.Session |
newSession(Collection<String> sources,
Collection<String> restrict,
Set<String> candidateDocumentTypes) |
IndexFacts.Session |
newSession(Query query) |
private Set<String> |
resolveDocumentTypes(Collection<String> sources,
Collection<String> restrict,
Set<String> candidateDocumentTypes)
Given a search list which is a mixture of document types and cluster
names, and a restrict list which is a list of document types, return a
set of all valid document types for this combination.
|
private Set<String> |
resolveDocumentTypes(Query query)
Calls resolveDocumentTypes(query.getModel().getSources(), query.getModel().getRestrict())
|
void |
setClusters(Map<String,List<String>> clusters)
Public only for testing.
|
private void |
setMasterClusters(Map<String,List<String>> clusters) |
void |
setSearchDefinitions(Map<String,SearchDefinition> searchDefinitions,
SearchDefinition unionSearchDefinition)
Deprecated.
set indexes at creation time instead
|
private Map<String,SearchDefinition> searchDefinitions
private Map<String,List<String>> clusters
@Deprecated public static final String unionName
private SearchDefinition unionSearchDefinition
private boolean frozen
private boolean hasNGramIndices
public IndexFacts()
public IndexFacts(IndexModel indexModel)
public List<String> clustersHavingSearchDefinition(String searchDefinitionName)
@Deprecated public void setSearchDefinitions(Map<String,SearchDefinition> searchDefinitions, SearchDefinition unionSearchDefinition)
private boolean isInitialized()
private boolean isIndexFromDocumentTypes(String indexName, List<String> documentTypes)
private String getCanonicNameFromDocumentTypes(String indexName, List<String> documentTypes)
private Index getIndexFromDocumentTypes(String indexName, List<String> documentTypes)
private Index getIndexByCanonicNameFromDocumentTypes(String canonicName, List<String> documentTypes)
private Collection<Index> getIndexes(String documentType)
private Set<String> resolveDocumentTypes(Query query)
private Set<String> resolveDocumentTypes(Collection<String> sources, Collection<String> restrict, Set<String> candidateDocumentTypes)
Model.getSources()
and
Model.getRestrict()
as input parameters
before calling any other method of this class.sources
- the search list for a queryrestrict
- the restrict list for a queryprivate Collection<String> emptyCollectionIfNull(Collection<String> collection)
private IndexFacts.DocumentTypeListOffset chooseSearchDefinition(List<String> documentTypes, int index)
public void freeze()
public boolean hasNGramIndices()
public boolean isFrozen()
private void ensureNotFrozen()
@Deprecated public void addIndex(String sdName, String indexName)
sdName
- name of search definition containing index, if null, modify default setindexName
- name of index, actual or otherwise@Deprecated public void addIndex(String sdName, Index index)
public IndexFacts.Session newSession(Query query)
public IndexFacts.Session newSession(Collection<String> sources, Collection<String> restrict)
public IndexFacts.Session newSession(Collection<String> sources, Collection<String> restrict, Set<String> candidateDocumentTypes)
Copyright © 2018. All rights reserved.