Package com.sematext.searchschemer.index

Examples of com.sematext.searchschemer.index.IndexStructure


        "<table uid=\"id\">\n <column name=\"cat\" type=\"string\" />\n</table>", writer.toString());
  }

  @Test
  public void testWriteNonDynamicMultiple() throws Exception {
    IndexStructure structure = new BasicIndexStructure();
    structure.addField("cat", new SenseiDBFieldAttributes("cat", "string", "analyzed", "yes"), false);
    structure.addField("menu", new SenseiDBFieldAttributes("menu", "string", "no", "yes"), false);

    StringWriter writer = new StringWriter();
    SenseidbIndexStructureWriter senseiIndexStructureWriter = new SenseidbIndexStructureWriter();
    senseiIndexStructureWriter.write(structure, writer);
View Full Code Here


    SolrStaticFieldsDefinitionReader reader = new SolrStaticFieldsDefinitionReader(new File(file));
    SolrDynamicFieldsDefinitionReader readerDynamic = new SolrDynamicFieldsDefinitionReader(new File(file));
    try {
      List<FieldAttributes> fields = reader.readFields();
      List<FieldAttributes> dynamicFields = readerDynamic.readFields();
      IndexStructure structure = new BasicIndexStructure();
      for (FieldAttributes field : fields) {
        structure.addField(field.name(), field);
      }
      for (FieldAttributes field : dynamicFields) {
        structure.addField(field.name(), field, true);
      }
      return structure;
    } catch (SAXException ex) {
      throw new IOException("Schema parsing error occured", ex);
    }
View Full Code Here

  @Override
  public IndexStructure read(String file) throws IOException {
    SenseiDBFieldsDefinitionReader reader = new SenseiDBFieldsDefinitionReader(new File(file));
    try {
      List<FieldAttributes> fields = reader.readFields();
      IndexStructure structure = new BasicIndexStructure();
      for (FieldAttributes field : fields) {
        structure.addField(field.name(), field);
      }
      return structure;
    } catch (SAXException ex) {
      throw new IOException("SenseiDB schema parsing error occured", ex);
    }
View Full Code Here

   */
  @Override
  public IndexStructure read(String file) throws IOException {
    ElasticSearchFieldsDefinitionReader reader = new ElasticSearchFieldsDefinitionReader(new File(file));
    List<FieldAttributes> fields = reader.readFields();
    IndexStructure structure = new BasicIndexStructure();
    for (FieldAttributes field : fields) {
      structure.addField(field.name(), field);
    }
    return structure;
  }
View Full Code Here

TOP

Related Classes of com.sematext.searchschemer.index.IndexStructure

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.