Package org.sindice.siren.analysis

Examples of org.sindice.siren.analysis.LongNumericAnalyzer


  throws Exception {
    final String qnames = "./src/test/resources/conf/qnames";
    final HashMap<ConfigurationKey, Object> config = new HashMap<ConfigurationKey, Object>();
    config.put(KeywordConfigurationKeys.QNAMES, this.loadQNamesFile(qnames));
    final Map<String, Analyzer> dts = new HashMap<String, Analyzer>();
    dts.put(XSDDatatype.XSD_LONG, new LongNumericAnalyzer(4));
    config.put(KeywordConfigurationKeys.DATATYPES_ANALYZERS, dts);

    final NodeNumericRangeQuery q = NodeNumericRangeQuery.newLongRange(SirenTestCase.DEFAULT_TEST_FIELD,
      4, 50l, 60l, true, false);
    q.setDatatype(XSDDatatype.XSD_LONG);
View Full Code Here


  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
    assertOpenRange(config, "int4");
View Full Code Here

    // Set the SIREn fields
    codec.addSirenFields("field8", "field6", "field4", "field2", "field" + Integer.MAX_VALUE,
      "ascfield8", "ascfield6", "ascfield4", "ascfield2",
      "double8", "double6", "double4", "double2");
    // Set the datatype analyzers
    tupleAnalyzer.registerDatatype((XSDDatatype.XSD_LONG+"8").toCharArray(), new LongNumericAnalyzer(8));
    tupleAnalyzer.registerDatatype((XSDDatatype.XSD_LONG+"6").toCharArray(), new LongNumericAnalyzer(6));
    tupleAnalyzer.registerDatatype((XSDDatatype.XSD_LONG+"4").toCharArray(), new LongNumericAnalyzer(4));
    tupleAnalyzer.registerDatatype((XSDDatatype.XSD_LONG+"2").toCharArray(), new LongNumericAnalyzer(2));
    tupleAnalyzer.registerDatatype((XSDDatatype.XSD_DOUBLE+"8").toCharArray(), new DoubleNumericAnalyzer(8));
    tupleAnalyzer.registerDatatype((XSDDatatype.XSD_DOUBLE+"6").toCharArray(), new DoubleNumericAnalyzer(6));
    tupleAnalyzer.registerDatatype((XSDDatatype.XSD_DOUBLE+"4").toCharArray(), new DoubleNumericAnalyzer(4));
    tupleAnalyzer.registerDatatype((XSDDatatype.XSD_DOUBLE+"2").toCharArray(), new DoubleNumericAnalyzer(2));
    tupleAnalyzer.registerDatatype((XSDDatatype.XSD_LONG+Integer.MAX_VALUE).toCharArray(), new LongNumericAnalyzer(Integer.MAX_VALUE));

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

      case INTEGER:
        queryAnalyzer = analyzer = new IntNumericAnalyzer(precisionStep);
        break;

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

      case FLOAT:
        queryAnalyzer = analyzer = new FloatNumericAnalyzer(precisionStep);
        break;
View Full Code Here

TOP

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

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.