Tabnine Logo
Term.createTerm
Code IndexAdd Tabnine to your IDE (free)

How to use
createTerm
method
in
org.apache.lucene.index.Term

Best Java code snippets using org.apache.lucene.index.Term.createTerm (Showing top 20 results out of 315)

origin: tjake/Solandra

Term term = idTerm.createTerm(idFieldType.toInternal(cmd.id));
origin: tjake/Solandra

  logger.debug("Adding " + shardedId + " to " + indexName);
Term idTerm = this.idTerm.createTerm(cmd.indexedId);
origin: org.apache.jackrabbit/jackrabbit-core

  /**
   * Creates a Term with the given <code>id</code> value and with a field
   * name {@link FieldNames#UUID}.
   *
   * @param id the id.
   * @return the UUIDTerm.
   */
  public static Term createUUIDTerm(String id) {
    return UUID_TERM_TEMPLATE.createTerm(id);
  }
}
origin: apache/jackrabbit

  /**
   * Creates a Term with the given <code>id</code> value and with a field
   * name {@link FieldNames#UUID}.
   *
   * @param id the id.
   * @return the UUIDTerm.
   */
  public static Term createUUIDTerm(String id) {
    return UUID_TERM_TEMPLATE.createTerm(id);
  }
}
origin: org.dspace.dependencies.solr/dspace-solr-core

Term createTerm(String termVal) {
 return fterm.createTerm(termVal);
}
origin: org.dspace.dependencies.solr/dspace-solr-core

public boolean skipTo(String target) throws IOException {
 return skipTo(tindex.fterm.createTerm(target));
}
origin: org.apache.jackrabbit/jackrabbit-core

public Term term() {
  Term t = super.term();
  if (t == null) {
    return t;
  }
  if (t.field().equals(FieldNames.PROPERTIES)) {
    String text = t.text();
    return t.createTerm(text.replace(oldSepChar, '['));
  } else {
    return t;
  }
}
origin: apache/jackrabbit

public Term term() {
  Term t = super.term();
  if (t == null) {
    return t;
  }
  if (t.field().equals(FieldNames.PROPERTIES)) {
    String text = t.text();
    return t.createTerm(text.replace(oldSepChar, '['));
  } else {
    return t;
  }
}
origin: org.apache.jackrabbit/jackrabbit-core

public void seek(Term term) throws IOException {
  if (term.field().equals(FieldNames.PROPERTIES)) {
    char[] text = term.text().toCharArray();
    text[term.text().indexOf('[')] = oldSepChar;
    super.seek(term.createTerm(new String(text)));
  } else {
    super.seek(term);
  }
}
origin: apache/jackrabbit

public void seek(Term term) throws IOException {
  if (term.field().equals(FieldNames.PROPERTIES)) {
    char[] text = term.text().toCharArray();
    text[term.text().indexOf('[')] = oldSepChar;
    super.seek(term.createTerm(new String(text)));
  } else {
    super.seek(term);
  }
}
origin: org.exoplatform.jcr/exo.jcr.component.core

public void seek(Term term) throws IOException
{
 if (term.field().equals(FieldNames.PROPERTIES))
 {
   char[] text = term.text().toCharArray();
   text[term.text().indexOf('[')] = '\uFFFF';
   super.seek(term.createTerm(new String(text)));
 }
 else
 {
   super.seek(term);
 }
}
origin: eu.fbk.twm/twm-index

public String search(String key) {
  String result = null;
  try {
    TermDocs termDocs = indexReader.termDocs(keyTerm.createTerm(key));
    if (termDocs.next()) {
      Document doc = indexReader.document(termDocs.doc());
      result = doc.get(valueFieldName);
    }
  } catch (IOException e) {
    logger.error(e);
  }
  return result;
}
origin: org.exoplatform.jcr/exo.jcr.component.core

public Term term()
{
 Term t = super.term();
 if (t == null)
 {
   return t;
 }
 if (t.field().equals(FieldNames.PROPERTIES))
 {
   String text = t.text();
   return t.createTerm(text.replace('\uFFFF', '['));
 }
 else
 {
   return t;
 }
}
origin: org.dspace.dependencies.solr/dspace-solr-core

private int getDocFreq(String term) {
 int result = 1;
 currentTerm = currentTerm.createTerm(term);
 try {
  TermEnum termEnum = reader.terms(currentTerm);
  if (termEnum != null && termEnum.term().equals(currentTerm)) {
   result = termEnum.docFreq();
  }
 } catch (IOException e) {
  throw new RuntimeException(e);
 }
 return result;
}
origin: eu.fbk.twm/twm-index

public String search(String key) {
  String ret = null;
  try {
    TermDocs termDocs = indexReader.termDocs(keyTerm.createTerm(key));
    if (termDocs.next()) {
      Document doc = indexReader.document(termDocs.doc());
      ret = new String(doc.getBinaryValue(valueFieldName));
    }
  } catch (IOException e) {
    logger.error(e);
  }
  return ret;
}
origin: eu.fbk.twm/twm-index

public String search(String page) {
  String pageAbstract = null;
  try {
    TermDocs termDocs = indexReader.termDocs(keyTerm.createTerm(page));
    if (termDocs.next()) {
      Document doc = indexReader.document(termDocs.doc());
      pageAbstract = new String(doc.getBinaryValue("xml"));
    }
  } catch (Exception e) {
    return new String();
  }
  return pageAbstract;
}
origin: org.apache.lucene/lucene-spellchecker

/**
 * Check whether the word exists in the index.
 * @param word
 * @throws IOException
 * @throws AlreadyClosedException if the Spellchecker is already closed
 * @return true if the word exists in the index
 */
public boolean exist(String word) throws IOException {
 // obtainSearcher calls ensureOpen
 final IndexSearcher indexSearcher = obtainSearcher();
 try{
  return indexSearcher.docFreq(F_WORD_TERM.createTerm(word)) > 0;
 } finally {
  releaseSearcher(indexSearcher);
 }
}
origin: org.dspace.dependencies.solr/dspace-solr-core

private NamedList getListedTermCounts(String field, String termList) throws IOException {
 FieldType ft = searcher.getSchema().getFieldType(field);
 List<String> terms = StrUtils.splitSmart(termList, ",", true);
 NamedList res = new NamedList();
 Term t = new Term(field);
 for (String term : terms) {
  String internal = ft.toInternal(term);
  int count = searcher.numDocs(new TermQuery(t.createTerm(internal)), base);
  res.add(term, count);
 }
 return res;    
}
origin: eu.fbk.twm/twm-index

public Integer search(String key) {
  Integer ret = null;
  try {
    TermDocs termDocs = indexReader.termDocs(keyTerm.createTerm(key));
    if (termDocs.next()) {
      Document doc = indexReader.document(termDocs.doc());
      ret = SerialUtils.toInt(doc.getBinaryValue(valueFieldName));
    }
  } catch (IOException e) {
    logger.error(e);
  }
  return ret;
}
origin: org.compass-project/compass

  public Term replaceTerm(Term term) throws SearchEngineException {
    try {
      if (spellChecker.exist(term.text())) {
        return term;
      }
      String[] similarWords = spellChecker.suggestSimilar(term.text(), getDefaultNumberOfSuggestions());
      if (similarWords.length == 0) {
        return term;
      }
      suggestedQuery.set(true);
      return term.createTerm(similarWords[0]);
    } catch (IOException e) {
      throw new SearchEngineException("Failed to suggest for query", e);
    }
  }
});
org.apache.lucene.indexTermcreateTerm

Javadoc

Optimized construction of new Terms by reusing same field as this Term - avoids field.intern() overhead

Popular methods of Term

  • <init>
    Constructs a Term with the given field and the bytes from a builder.Note that a null field value res
  • text
    Returns the text of this term. In the case of words, this is simply the text of the word. In the cas
  • field
    Returns the field of this term, an interned string. The field indicates the part of a document which
  • bytes
    Returns the bytes of this term, these should not be modified.
  • equals
    Compares two terms, returning true iff they have the same field and text.
  • hashCode
    Combines the hashCode() of the field and the text.
  • toString
    Returns human-readable form of the term text. If the term is not unicode, the raw bytes will be prin
  • compareTo
    Compares two terms, returning an integer which is less than zero iff this term belongs after the arg
  • generate
  • getCoeff
  • getEntitiesList
  • getExp
  • getEntitiesList,
  • getExp,
  • getName,
  • getPropertyMap,
  • set,
  • setAbbr1,
  • setAbbr2,
  • setCode,
  • setData

Popular in Java

  • Finding current android device location
  • onCreateOptionsMenu (Activity)
  • requestLocationUpdates (LocationManager)
  • findViewById (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Best plugins for Eclipse
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