Package org.apache.lucene.index

Examples of org.apache.lucene.index.Term.field()


                    lowerLimit.append(upperTermStr);
                    upperLimit = new StringBuffer(propName);
                    upperLimit.append(lowerTermStr);
                    upperLimit.setCharAt(nameLength, Character.toUpperCase(upperLimit.charAt(nameLength)));
                    rangeScans.add(new RangeScan(reader,
                            new Term(term.field(), lowerLimit.toString()),
                            new Term(term.field(), upperLimit.toString())));

                } else {
                    // use term as is
                    rangeScans.add(new RangeScan(reader, term, term));
View Full Code Here


                    upperLimit = new StringBuffer(propName);
                    upperLimit.append(lowerTermStr);
                    upperLimit.setCharAt(nameLength, Character.toUpperCase(upperLimit.charAt(nameLength)));
                    rangeScans.add(new RangeScan(reader,
                            new Term(term.field(), lowerLimit.toString()),
                            new Term(term.field(), upperLimit.toString())));

                } else {
                    // use term as is
                    rangeScans.add(new RangeScan(reader, term, term));
                }
View Full Code Here

      // only keep terms for fulltext fields
      Iterator it = extractedTerms.iterator();
      while (it.hasNext())
      {
         Term t = (Term)it.next();
         if (t.field().equals(FieldNames.FULLTEXT))
         {
            relevantTerms.add(t);
         }
         else
         {
View Full Code Here

         {
            relevantTerms.add(t);
         }
         else
         {
            int idx = t.field().indexOf(FieldNames.FULLTEXT_PREFIX);
            if (idx != -1)
            {
               relevantTerms.add(new Term(FieldNames.FULLTEXT, t.text()));
            }
         }
View Full Code Here

                TermEnum terms = reader.terms(start);
                try {
                    int count = 0;
                    do {
                        Term t = terms.term();
                        if (t != null && t.field() == start.field()) {
                            tDocs.seek(terms);
                            collector.collect(t, tDocs);
                        } else {
                            break;
                        }
View Full Code Here

        buffer.append("(");
        buffer.append(c.getQuery().toString(""));
        buffer.append(")");
      } else if (subQuery instanceof TermQuery) {
        final Term term = ((TermQuery) subQuery).getTerm();
        buffer.append(term.field());
        buffer.append(":\"");
        buffer.append(term.text());
        buffer.append("\"");
      } else {
        buffer.append(" ");
View Full Code Here

                TermDocs docs = reader.termDocs();
                try {
                    do {
                        Term term = enumerator.term();
                        if (term != null && term.field() == testField) {
                            if (!checkLower || term.text().compareTo(lowerTerm.text()) > 0) {
                                checkLower = false;
                                if (upperTerm != null) {
                                    int compare = upperTerm.text().compareTo(term.text());
                                    // if beyond the upper term, or is exclusive and
View Full Code Here

        query.extractTerms(extractedTerms);
        // only keep terms for fulltext fields
        Iterator it = extractedTerms.iterator();
        while (it.hasNext()) {
            Term t = (Term) it.next();
            if (t.field().equals(FieldNames.FULLTEXT)) {
                relevantTerms.add(t);
            } else {
                int idx = t.field().indexOf(FieldNames.FULLTEXT_PREFIX);
                if (idx != -1) {
                    relevantTerms.add(new Term(FieldNames.FULLTEXT, t.text()));
View Full Code Here

        while (it.hasNext()) {
            Term t = (Term) it.next();
            if (t.field().equals(FieldNames.FULLTEXT)) {
                relevantTerms.add(t);
            } else {
                int idx = t.field().indexOf(FieldNames.FULLTEXT_PREFIX);
                if (idx != -1) {
                    relevantTerms.add(new Term(FieldNames.FULLTEXT, t.text()));
                }
            }
        }
View Full Code Here

      return query;
    }
    if (query instanceof TermQuery) {
      TermQuery tq = (TermQuery) query;
      Term term = tq.getTerm();
      if (term.field().equals(fieldLessFieldName)) {
        return new TermQuery(new Term(name, term.bytes()));
      }
    } else if (query instanceof WildcardQuery) {
      WildcardQuery wq = (WildcardQuery) query;
      Term term = wq.getTerm();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.