Package org.fao.geonet.kernel.search.LuceneConfig

Examples of org.fao.geonet.kernel.search.LuceneConfig.LuceneConfigNumericField


      String  lowerTxt   = xmlQuery.getAttributeValue("lowerTxt");
      String  upperTxt   = xmlQuery.getAttributeValue("upperTxt");
      String  sInclusive = xmlQuery.getAttributeValue("inclusive");
      boolean inclusive  = "true".equals(sInclusive);

      LuceneConfigNumericField fieldConfig = numericFieldSet .get(fld);
      if (fieldConfig != null) {
        returnValue = LuceneQueryBuilder.buildNumericRangeQueryForType(fld, lowerTxt, upperTxt, inclusive, inclusive, fieldConfig.getType());
      } else {
        lowerTxt = (lowerTxt == null ? null : LuceneSearcher.analyzeQueryText(fld, lowerTxt, analyzer, tokenizedFieldSet));
        upperTxt = (upperTxt == null ? null : LuceneSearcher.analyzeQueryText(fld, upperTxt, analyzer, tokenizedFieldSet));

        returnValue = TermRangeQuery.newStringRange(fld, lowerTxt, upperTxt, inclusive, inclusive);
View Full Code Here


   * @param fieldType
   * @return
   * @throws Exception
   */
  private Field addNumericField(String name, String string, FieldType fieldType) throws Exception {
        LuceneConfigNumericField fieldConfig = _luceneConfig.getNumericField(name);
   
    Field field;
    // TODO : reuse the numeric field for better performance
        if(Log.isDebugEnabled(Geonet.INDEX_ENGINE))
            Log.debug(Geonet.INDEX_ENGINE, "Indexing numeric field: " + name + " with value: " + string );
    try {
      String paramType = fieldConfig.getType();
      if ("double".equals(paramType)) {
        double d = Double.valueOf(string);
        fieldType.setNumericType(NumericType.DOUBLE);
        field = new DoubleField(name, d, fieldType);
      }
View Full Code Here

TOP

Related Classes of org.fao.geonet.kernel.search.LuceneConfig.LuceneConfigNumericField

Copyright © 2018 www.massapicom. 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.