Class OLuceneIndexNotUnique

java.lang.Object
com.orientechnologies.orient.core.index.OIndexAbstract
com.orientechnologies.lucene.index.OLuceneIndexNotUnique
All Implemented Interfaces:
OLuceneIndex, OIndex, OIndexInternal, Comparable<OIndex>
Direct Known Subclasses:
OLuceneFullTextIndex, OLuceneSpatialIndex

public class OLuceneIndexNotUnique extends OIndexAbstract implements OLuceneIndex
  • Constructor Details

  • Method Details

    • rebuild

      public long rebuild(OProgressListener iProgressListener)
      Description copied from class: OIndexAbstract
      Populate the index with all the existent records.
      Specified by:
      rebuild in interface OIndex
      Overrides:
      rebuild in class OIndexAbstract
    • remove

      public boolean remove(Object key, OIdentifiable rid)
      Description copied from interface: OIndex
      Removes an entry by its key and value.
      Specified by:
      remove in interface OIndex
      Overrides:
      remove in class OIndexAbstract
      Parameters:
      key - The entry's key to remove
      Returns:
      True if the entry has been found and removed, otherwise false
    • remove

      public boolean remove(Object key)
      Description copied from interface: OIndex
      Removes an entry by its key.
      Specified by:
      remove in interface OIndex
      Overrides:
      remove in class OIndexAbstract
      Parameters:
      key - The entry's key to remove
      Returns:
      True if the entry has been found and removed, otherwise false
    • removeCluster

      public OIndexAbstract removeCluster(String iClusterName)
      Description copied from interface: OIndexInternal
      Remove given cluster from the list of clusters that should be automatically indexed.
      Specified by:
      removeCluster in interface OIndexInternal
      Overrides:
      removeCluster in class OIndexAbstract
      Parameters:
      iClusterName - Cluster to remove.
      Returns:
      Current index instance.
    • interpretTxKeyChanges

      Description copied from class: OIndexAbstract
      Interprets transaction index changes for a certain key. Override it to customize index behaviour on interpreting index changes. This may be viewed as an optimization, but in some cases this is a requirement. For example, if you put multiple values under the same key during the transaction for single-valued/unique index, but remove all of them except one before commit, there is no point in throwing ORecordDuplicatedException while applying index changes.
      Specified by:
      interpretTxKeyChanges in interface OIndexInternal
      Overrides:
      interpretTxKeyChanges in class OIndexAbstract
      Parameters:
      changes - the changes to interpret.
      Returns:
      the interpreted index key changes.
    • getCollatingValue

      public Object getCollatingValue(Object key)
      Specified by:
      getCollatingValue in interface OIndexInternal
      Overrides:
      getCollatingValue in class OIndexAbstract
    • doDelete

      public void doDelete()
      Overrides:
      doDelete in class OIndexAbstract
    • decodeKey

      protected Object decodeKey(Object key)
    • populateIndex

      protected void populateIndex(ODocument doc, Object fieldValue)
    • encodeKey

      protected Object encodeKey(Object key)
    • get

      Deprecated.
      Description copied from interface: OIndex
      Gets the set of records associated with the passed key.
      Specified by:
      get in interface OIndex
      Parameters:
      key - The key to search
      Returns:
      The Record set if found, otherwise an empty Set
    • getRidsIgnoreTx

      public Stream<ORID> getRidsIgnoreTx(Object key)
      Specified by:
      getRidsIgnoreTx in interface OIndexInternal
    • getRids

      public Stream<ORID> getRids(Object key)
      Specified by:
      getRids in interface OIndexInternal
    • put

      public OLuceneIndexNotUnique put(Object key, OIdentifiable value)
      Description copied from interface: OIndex
      Inserts a new entry in the index. The behaviour depends by the index implementation.
      Specified by:
      put in interface OIndex
      Parameters:
      key - Entry's key
      value - Entry's value as OIdentifiable instance
      Returns:
      The index instance itself to allow in chain calls
    • size

      public long size()
      Specified by:
      size in interface OIndexInternal
      Returns:
      number of entries in the index.
    • streamEntries

      public Stream<ORawPair<Object,ORID>> streamEntries(Collection<?> keys, boolean ascSortOrder)
      Description copied from interface: OIndexInternal
      Returns stream which presents data associated with passed in keys.
      Specified by:
      streamEntries in interface OIndexInternal
      Parameters:
      keys - Keys data of which should be returned.
      ascSortOrder - Flag which determines whether data iterated by stream should be in ascending or descending order.
      Returns:
      stream which presents data associated with passed in keys.
    • streamEntriesBetween

      public Stream<ORawPair<Object,ORID>> streamEntriesBetween(Object fromKey, boolean fromInclusive, Object toKey, boolean toInclusive, boolean ascOrder)
      Description copied from interface: OIndexInternal
      Returns stream which presents subset of index data between passed in keys.
      Specified by:
      streamEntriesBetween in interface OIndexInternal
      Parameters:
      fromKey - Lower border of index data.
      fromInclusive - Indicates whether lower border should be inclusive or exclusive.
      toKey - Upper border of index data.
      toInclusive - Indicates whether upper border should be inclusive or exclusive.
      ascOrder - Flag which determines whether data iterated by stream should be in ascending or descending order.
      Returns:
      Cursor which presents subset of index data between passed in keys.
    • streamEntriesMajor

      public Stream<ORawPair<Object,ORID>> streamEntriesMajor(Object fromKey, boolean fromInclusive, boolean ascOrder)
      Description copied from interface: OIndexInternal
      Returns stream which presents subset of data which associated with key which is greater than passed in key.
      Specified by:
      streamEntriesMajor in interface OIndexInternal
      Parameters:
      fromKey - Lower border of index data.
      fromInclusive - Indicates whether lower border should be inclusive or exclusive.
      ascOrder - Flag which determines whether data iterated by stream should be in ascending or descending order.
      Returns:
      stream which presents subset of data which associated with key which is greater than passed in key.
    • streamEntriesMinor

      public Stream<ORawPair<Object,ORID>> streamEntriesMinor(Object toKey, boolean toInclusive, boolean ascOrder)
      Description copied from interface: OIndexInternal
      Returns stream which presents subset of data which associated with key which is less than passed in key.
      Specified by:
      streamEntriesMinor in interface OIndexInternal
      Parameters:
      toKey - Upper border of index data.
      toInclusive - Indicates Indicates whether upper border should be inclusive or exclusive.
      ascOrder - Flag which determines whether data iterated by stream should be in ascending or descending order.
      Returns:
      stream which presents subset of data which associated with key which is less than passed in key.
    • isNativeTxSupported

      public boolean isNativeTxSupported()
      Specified by:
      isNativeTxSupported in interface OIndexInternal
    • stream

      public Stream<ORawPair<Object,ORID>> stream()
      Specified by:
      stream in interface OIndexInternal
    • descStream

      public Stream<ORawPair<Object,ORID>> descStream()
      Specified by:
      descStream in interface OIndexInternal
    • supportsOrderedIterations

      public boolean supportsOrderedIterations()
      Specified by:
      supportsOrderedIterations in interface OIndex
    • searcher

      public org.apache.lucene.search.IndexSearcher searcher()
      Specified by:
      searcher in interface OLuceneIndex
    • canBeUsedInEqualityOperators

      public boolean canBeUsedInEqualityOperators()
      Specified by:
      canBeUsedInEqualityOperators in interface OIndexInternal