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

  • Updating database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • getResourceAsStream (ClassLoader)
  • getApplicationContext (Context)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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