congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
SortField.rewrite
Code IndexAdd Tabnine to your IDE (free)

How to use
rewrite
method
in
org.apache.lucene.search.SortField

Best Java code snippets using org.apache.lucene.search.SortField.rewrite (Showing top 4 results out of 315)

origin: org.apache.lucene/lucene-core

/**
 * Rewrites the SortFields in this Sort, returning a new Sort if any of the fields
 * changes during their rewriting.
 *
 * @param searcher IndexSearcher to use in the rewriting
 * @return {@code this} if the Sort/Fields have not changed, or a new Sort if there
 *        is a change
 * @throws IOException Can be thrown by the rewriting
 * @lucene.experimental
 */
public Sort rewrite(IndexSearcher searcher) throws IOException {
 boolean changed = false;
 
 SortField[] rewrittenSortFields = new SortField[fields.length];
 for (int i = 0; i < fields.length; i++) {
  rewrittenSortFields[i] = fields[i].rewrite(searcher);
  if (fields[i] != rewrittenSortFields[i]) {
   changed = true;
  }
 }
 return (changed) ? new Sort(rewrittenSortFields) : this;
}
origin: org.infinispan/infinispan-embedded-query

/**
 * Rewrites the SortFields in this Sort, returning a new Sort if any of the fields
 * changes during their rewriting.
 *
 * @param searcher IndexSearcher to use in the rewriting
 * @return {@code this} if the Sort/Fields have not changed, or a new Sort if there
 *        is a change
 * @throws IOException Can be thrown by the rewriting
 * @lucene.experimental
 */
public Sort rewrite(IndexSearcher searcher) throws IOException {
 boolean changed = false;
 
 SortField[] rewrittenSortFields = new SortField[fields.length];
 for (int i = 0; i < fields.length; i++) {
  rewrittenSortFields[i] = fields[i].rewrite(searcher);
  if (fields[i] != rewrittenSortFields[i]) {
   changed = true;
  }
 }
 return (changed) ? new Sort(rewrittenSortFields) : this;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

/**
 * Rewrites the SortFields in this Sort, returning a new Sort if any of the fields
 * changes during their rewriting.
 *
 * @param searcher IndexSearcher to use in the rewriting
 * @return {@code this} if the Sort/Fields have not changed, or a new Sort if there
 *        is a change
 * @throws IOException Can be thrown by the rewriting
 * @lucene.experimental
 */
public Sort rewrite(IndexSearcher searcher) throws IOException {
 boolean changed = false;
 
 SortField[] rewrittenSortFields = new SortField[fields.length];
 for (int i = 0; i < fields.length; i++) {
  rewrittenSortFields[i] = fields[i].rewrite(searcher);
  if (fields[i] != rewrittenSortFields[i]) {
   changed = true;
  }
 }
 return (changed) ? new Sort(rewrittenSortFields) : this;
}
origin: harbby/presto-connectors

/**
 * Rewrites the SortFields in this Sort, returning a new Sort if any of the fields
 * changes during their rewriting.
 *
 * @param searcher IndexSearcher to use in the rewriting
 * @return {@code this} if the Sort/Fields have not changed, or a new Sort if there
 *        is a change
 * @throws IOException Can be thrown by the rewriting
 * @lucene.experimental
 */
public Sort rewrite(IndexSearcher searcher) throws IOException {
 boolean changed = false;
 
 SortField[] rewrittenSortFields = new SortField[fields.length];
 for (int i = 0; i < fields.length; i++) {
  rewrittenSortFields[i] = fields[i].rewrite(searcher);
  if (fields[i] != rewrittenSortFields[i]) {
   changed = true;
  }
 }
 return (changed) ? new Sort(rewrittenSortFields) : this;
}
org.apache.lucene.searchSortFieldrewrite

Javadoc

Rewrites this SortField, returning a new SortField if a change is made. Subclasses should override this define their rewriting behavior when this SortField is of type SortField.Type#REWRITEABLE

Popular methods of SortField

  • <init>
    Creates a sort, possibly in reverse, by terms in the given field where the type of term value is det
  • getField
    Returns the name of the field. Could return null if the sort is by SCORE or DOC.
  • getReverse
    Returns whether the sort should be reversed.
  • getType
    Returns the type of contents in the field.
  • setMissingValue
    Set the value to use for documents that don't have a value.
  • equals
    Returns true if o is equal to this. If a FieldComparatorSource was provided, it must properly implem
  • getComparator
    Returns the FieldComparator to use for sorting.
  • getComparatorSource
    Returns the FieldComparatorSource used for custom sorting
  • getMissingValue
    Return the value to use for documents that don't have a value. A value of null indicates that defaul
  • toString
  • hashCode
    Returns a hash code for this SortField instance. If a FieldComparatorSource was provided, it must pr
  • needsScores
    Whether the relevance score is needed to sort documents.
  • hashCode,
  • needsScores,
  • getFactory,
  • getLocale,
  • initFieldType

Popular in Java

  • Making http requests using okhttp
  • onCreateOptionsMenu (Activity)
  • requestLocationUpdates (LocationManager)
  • setRequestProperty (URLConnection)
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • JLabel (javax.swing)
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now