Examples of DocValuesType


Examples of org.apache.lucene.index.FieldInfo.DocValuesType

     * number assigned if possible otherwise the first unassigned field number
     * is used as the field number.
     */
    synchronized int addOrGet(String fieldName, int preferredFieldNumber, DocValuesType dvType) {
      if (dvType != null) {
        DocValuesType currentDVType = docValuesType.get(fieldName);
        if (currentDVType == null) {
          docValuesType.put(fieldName, dvType);
        } else if (currentDVType != null && currentDVType != dvType) {
          throw new IllegalArgumentException("cannot change DocValues type from " + currentDVType + " to " + dvType + " for field \"" + fieldName + "\"");
        }
View Full Code Here

Examples of org.apache.lucene.index.FieldInfo.DocValuesType

        // which is invalid.  We correct that, here:
        if (indexOptions != IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) {
          storePayloads = false;
        }
       
        DocValuesType normType = isIndexed && !omitNorms ? DocValuesType.NUMERIC : null;
        if (format == PreFlexRWFieldInfosWriter.FORMAT_PREFLEX_RW && normType != null) {
          // RW can have norms but doesn't write them
          normType = input.readByte() != 0 ? DocValuesType.NUMERIC : null;
        }
       
View Full Code Here

Examples of org.apache.lucene.index.FieldInfo.DocValuesType

        random(),
        dir,
        newIndexWriterConfig(TEST_VERSION_CURRENT,
            new MockAnalyzer(random())).setMergePolicy(newLogMergePolicy()));
    boolean canUseIDV = !"Lucene3x".equals(w.w.getConfig().getCodec().getName());
    DocValuesType valueType = vts[random().nextInt(vts.length)];

    // 0
    Document doc = new Document();
    addGroupField(doc, groupField, "author1", canUseIDV, valueType);
    doc.add(newTextField("content", "random text", Field.Store.NO));
View Full Code Here

Examples of org.apache.lucene.index.FieldInfo.DocValuesType

          dir,
          newIndexWriterConfig(TEST_VERSION_CURRENT,
              new MockAnalyzer(random())));
      boolean preFlex = "Lucene3x".equals(w.w.getConfig().getCodec().getName());
      boolean canUseIDV = !preFlex;
      DocValuesType valueType = vts[random().nextInt(vts.length)];

      Document doc = new Document();
      Document docNoGroup = new Document();
      Field group = newStringField("group", "", Field.Store.NO);
      doc.add(group);
View Full Code Here

Examples of org.apache.lucene.index.FieldInfo.DocValuesType

  public static Document cloneDocument(Document doc1) {
    final Document doc2 = new Document();
    for(IndexableField f : doc1) {
      final Field field1 = (Field) f;
      final Field field2;
      final DocValuesType dvType = field1.fieldType().docValueType();
      if (dvType != null) {
        switch(dvType) {
          case NUMERIC:
            field2 = new NumericDocValuesField(field1.name(), field1.numericValue().longValue());
            break;
View Full Code Here

Examples of org.apache.lucene.index.FieldInfo.DocValuesType

      fields.put(fieldName, field);

      readLine();
      assert startsWith(TYPE) : scratch.utf8ToString();

      DocValuesType dvType = DocValuesType.valueOf(stripPrefix(TYPE));
      assert dvType != null;
      if (dvType == DocValuesType.NUMERIC) {
        readLine();
        assert startsWith(MINVALUE): "got " + scratch.utf8ToString() + " field=" + fieldName + " ext=" + ext;
        field.minValue = Long.parseLong(stripPrefix(MINVALUE));
View Full Code Here

Examples of org.apache.lucene.index.FieldInfo.DocValuesType

        boolean omitNorms = !Boolean.parseBoolean(readString(NORMS.length, scratch));
       
        SimpleTextUtil.readLine(input, scratch);
        assert StringHelper.startsWith(scratch, NORMS_TYPE);
        String nrmType = readString(NORMS_TYPE.length, scratch);
        final DocValuesType normsType = docValuesType(nrmType);
       
        SimpleTextUtil.readLine(input, scratch);
        assert StringHelper.startsWith(scratch, DOCVALUES);
        String dvType = readString(DOCVALUES.length, scratch);
        final DocValuesType docValuesType = docValuesType(dvType);
       
        SimpleTextUtil.readLine(input, scratch);
        assert StringHelper.startsWith(scratch, NUM_ATTS);
        int numAtts = Integer.parseInt(readString(NUM_ATTS.length, scratch));
        Map<String,String> atts = new HashMap<String,String>();
View Full Code Here

Examples of org.apache.lucene.index.FieldInfo.DocValuesType

      fields.put(fieldName, field);

      readLine();
      assert startsWith(TYPE) : scratch.utf8ToString();

      DocValuesType dvType = DocValuesType.valueOf(stripPrefix(TYPE));
      assert dvType != null;
      if (dvType == DocValuesType.NUMERIC) {
        readLine();
        assert startsWith(MINVALUE): "got " + scratch.utf8ToString() + " field=" + fieldName + " ext=" + ext;
        field.minValue = Long.parseLong(stripPrefix(MINVALUE));
View Full Code Here

Examples of org.apache.lucene.index.FieldInfo.DocValuesType

      fields.put(fieldName, field);

      readLine();
      assert startsWith(TYPE) : scratch.utf8ToString();

      DocValuesType dvType = DocValuesType.valueOf(stripPrefix(TYPE));
      assert dvType != null;
      if (dvType == DocValuesType.NUMERIC) {
        readLine();
        assert startsWith(MINVALUE): "got " + scratch.utf8ToString() + " field=" + fieldName + " ext=" + ext;
        field.minValue = Long.parseLong(stripPrefix(MINVALUE));
View Full Code Here

Examples of org.apache.lucene.index.FieldInfo.DocValuesType

        random(),
        dir,
        newIndexWriterConfig(TEST_VERSION_CURRENT,
            new MockAnalyzer(random())).setMergePolicy(newLogMergePolicy()));
    boolean canUseIDV = !"Lucene3x".equals(w.w.getConfig().getCodec().getName());
    DocValuesType valueType = vts[random().nextInt(vts.length)];

    // 0
    Document doc = new Document();
    addGroupField(doc, groupField, "author1", canUseIDV, valueType);
    doc.add(newTextField("content", "random text", Field.Store.YES));
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.