Package org.sindice.siren.analysis

Examples of org.sindice.siren.analysis.FloatNumericAnalyzer


  public void testNumericQuery2()
  throws Exception {
    final HashMap<ConfigurationKey, Object> config = new HashMap<ConfigurationKey, Object>();
    final Map<String, Analyzer> datatypes = new HashMap<String, Analyzer>();
    datatypes.put("int4", new IntNumericAnalyzer(4));
    datatypes.put("float4", new FloatNumericAnalyzer(4));
    datatypes.put("long4", new LongNumericAnalyzer(4));
    datatypes.put("double4", new DoubleNumericAnalyzer(4));
    config.put(KeywordConfigurationKeys.DATATYPES_ANALYZERS, datatypes);

    // Integer
View Full Code Here


  @Test
  public void testNumericQuery4()
  throws Exception {
    final HashMap<ConfigurationKey, Object> config = new HashMap<ConfigurationKey, Object>();
    final Map<String, Analyzer> datatypes = new HashMap<String, Analyzer>();
    datatypes.put("float", new FloatNumericAnalyzer(4));
    config.put(KeywordConfigurationKeys.DATATYPES_ANALYZERS, datatypes);

    final NodePrimitiveQuery q = NodeNumericRangeQuery
        .newFloatRange(SirenTestCase.DEFAULT_TEST_FIELD, 4, 50.5f, 1000.34f, true, true);
    q.setDatatype("float");
View Full Code Here

      "float8", "float4", "float2");
    // Set the datatype analyzers
    tupleAnalyzer.registerDatatype((XSDDatatype.XSD_INT+"8").toCharArray(), new IntNumericAnalyzer(8));
    tupleAnalyzer.registerDatatype((XSDDatatype.XSD_INT+"4").toCharArray(), new IntNumericAnalyzer(4));
    tupleAnalyzer.registerDatatype((XSDDatatype.XSD_INT+"2").toCharArray(), new IntNumericAnalyzer(2));
    tupleAnalyzer.registerDatatype((XSDDatatype.XSD_FLOAT+"8").toCharArray(), new FloatNumericAnalyzer(8));
    tupleAnalyzer.registerDatatype((XSDDatatype.XSD_FLOAT+"4").toCharArray(), new FloatNumericAnalyzer(4));
    tupleAnalyzer.registerDatatype((XSDDatatype.XSD_FLOAT+"2").toCharArray(), new FloatNumericAnalyzer(2));
    tupleAnalyzer.registerDatatype((XSDDatatype.XSD_INT+Integer.MAX_VALUE).toCharArray(), new IntNumericAnalyzer(Integer.MAX_VALUE));

    index.directory = newDirectory();
    index.writer = newRandomIndexWriter(index.directory, tupleAnalyzer, codec);
  }
View Full Code Here

      case LONG:
        queryAnalyzer = analyzer = new LongNumericAnalyzer(precisionStep);
        break;

      case FLOAT:
        queryAnalyzer = analyzer = new FloatNumericAnalyzer(precisionStep);
        break;

      case DOUBLE:
        queryAnalyzer = analyzer = new DoubleNumericAnalyzer(precisionStep);
        break;
View Full Code Here

TOP

Related Classes of org.sindice.siren.analysis.FloatNumericAnalyzer

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.