public class IndexedData extends Object
IndexedDataFactory within
IndexedDataFactory.getIndexedData(IndexConfiguration, Collection) and
IndexedDataFactory.getIndexedData(IndexConfiguration, Collection).
Broadly it represents one lucene document including several fields. These fields provide a
boost factor and a tokenizing flag. Here localized and unlocalized fields are still kept together - the actual lucene
index will put the into different index directories later.| Modifier and Type | Class and Description |
|---|---|
class |
IndexedData.AttributeValue
Represents a single field within a
IndexedData record. |
| Constructor and Description |
|---|
IndexedData(PK typePK,
PK pk)
Creates a new lucene index representation for a specified item.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addGroup(String groupID)
Deprecated.
this has been used for filtering by item type - simply add a search term for the field 'type' to do
this
|
void |
addLocalized(PK languagePK,
String qualifier,
String text,
Double weight,
boolean exact)
Deprecated.
|
IndexedData.AttributeValue |
addLocalized(PK languagePK,
String qualifier,
String text,
Double weight,
boolean exact,
boolean storeData)
Adds a localized text to a specified (attribute) field.
|
void |
addUnlocalized(String qualifier,
String text,
Double weight,
boolean exact)
Deprecated.
use {
addUnlocalized(String, String, Double, boolean, boolean) instead. |
IndexedData.AttributeValue |
addUnlocalized(String qualifier,
String text,
Double weight,
boolean exact,
boolean storeData)
Adds a unlocalized text to a specified (attribute) field.
|
Map<PK,Collection<IndexedData.AttributeValue>> |
getAllValues()
Provides access to all stored
attribute values inside this object. |
List<String> |
getGroups()
Deprecated.
|
protected IndexedData.AttributeValue |
getLocalizedValue(PK langPK,
String fieldName)
Returns a single localized field for a given language and field qualifier or null if the field does not exist
within this record.
|
PK |
getPK()
Returns the item pk of the indexed record.
|
PK |
getTypePK()
Returns the type PK of the indexed record.
|
protected IndexedData.AttributeValue |
getUnlocalizedValue(String fieldName)
Returns a single unlocalized field or null if no such field exists within this record.
|
Collection<IndexedData.AttributeValue> |
getValues(PK langPK)
Returns all indexed fields for a given language.
|
protected List<String> |
groups(boolean create) |
void |
remove(IndexedData.AttributeValue value)
Removes a given attribute value from this container.
|
void |
removeLocalized(PK languagePK,
String qualifier)
Removes all localized values for a given language and field qualifier
|
void |
removeUnlocalized(String qualifier)
Removes all unlocalized values for a given field qualifier.
|
String |
toString()
returns a string with the layout
"IndexedData for {pk} [unlocalized={unlocalized}; localized={localized}; groups={groups}]"; |
protected List<IndexedData.AttributeValue> |
values(boolean create) |
public IndexedData(PK typePK, PK pk)
typePK - the pk of this item's ComposedTypepk - the pk of the itempublic PK getPK()
public PK getTypePK()
protected List<IndexedData.AttributeValue> values(boolean create)
@Deprecated public List<String> getGroups()
@Deprecated public void addUnlocalized(String qualifier, String text, Double weight, boolean exact)
addUnlocalized(String, String, Double, boolean, boolean) instead.public IndexedData.AttributeValue addUnlocalized(String qualifier, String text, Double weight, boolean exact, boolean storeData)
qualifier - the field resp. attribute qualifiertext - the text to add to the indexweight - the field weight to boost importance of matches within this fieldexact - if true the field value is not tokenized, meaning it will not be processed by any analyzer or
tokenizer. the index will store it unchangedpublic Collection<IndexedData.AttributeValue> getValues(PK langPK)
values which either
match the given language or have no language at all.langPK - the PK of the Language to get fields forpublic Map<PK,Collection<IndexedData.AttributeValue>> getAllValues()
attribute values inside this object.
The result map contains language PKs and their associated values. Please note that all unlocalized values are
mapped to the null language PK.
protected IndexedData.AttributeValue getLocalizedValue(PK langPK, String fieldName)
langPK - the pk of the Language to get fields forfieldName - the field nameprotected IndexedData.AttributeValue getUnlocalizedValue(String fieldName)
fieldName - the field name@Deprecated public void addLocalized(PK languagePK, String qualifier, String text, Double weight, boolean exact)
addLocalized(PK, String, String, Double, boolean, boolean) insteadpublic IndexedData.AttributeValue addLocalized(PK languagePK, String qualifier, String text, Double weight, boolean exact, boolean storeData)
languagePK - the Language pk which the value belongs toqualifier - the field resp. attribute qualifiertext - the text to add to the indexweight - the field weight to boost importance of matches within this fieldexact - if true the field value is not tokenized, meaning it will not be processed by any analyzer or
tokenizer. the index will store it unchangedpublic void remove(IndexedData.AttributeValue value)
public void removeUnlocalized(String qualifier)
qualifier - the field qualifierpublic void removeLocalized(PK languagePK, String qualifier)
languagePK - the language PKqualifier - the field qualifier@Deprecated public void addGroup(String groupID)
Copyright © 2017 SAP SE. All Rights Reserved.