Examples of IndexSchema


Examples of org.apache.solr.schema.IndexSchema

    // Initialize
    try {
      CoreContainer cores = new CoreContainer(new SolrResourceLoader(instanceDir));
      SolrConfig solrConfig = new SolrConfig(instanceDir, SolrConfig.DEFAULT_CONF_FILE, null);
      CoreDescriptor dcore = new CoreDescriptor(cores, "", solrConfig.getResourceLoader().getInstanceDir());
      IndexSchema indexSchema = new IndexSchema(solrConfig, instanceDir+"/conf/schema.xml", null);
      core = new SolrCore( null, dataDir, solrConfig, indexSchema, dcore);
      cores.register("", core, false);
      parser = new SolrRequestParsers( solrConfig );
    }
    catch (Exception ee) {
View Full Code Here

Examples of org.apache.solr.schema.IndexSchema

   */
  private static SimpleOrderedMap<Object> getCoreInfo( SolrCore core ) throws Exception
  {
    SimpleOrderedMap<Object> info = new SimpleOrderedMap<Object>();
   
    IndexSchema schema = core.getSchema();
    info.add( "schema", schema != null ? schema.getName():"no schema!" );
   
    // Host
    InetAddress addr = InetAddress.getLocalHost();
    info.add( "host", addr.getCanonicalHostName() );

View Full Code Here

Examples of org.apache.solr.schema.IndexSchema

  public static final int DEFAULT_COUNT = 10;
 
  @Override
  public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception
  {   
    IndexSchema schema = req.getSchema();
    SolrIndexSearcher searcher = req.getSearcher();
    IndexReader reader = searcher.getReader();
    SolrParams params = req.getParams();
    int numTerms = params.getInt( NUMTERMS, DEFAULT_COUNT );
       
    // Always show the core lucene info
    rsp.add("index", getIndexInfo(reader, numTerms>0 ) );

    Integer docId = params.getInt( DOC_ID );
    if( docId == null && params.get( ID ) != null ) {
      // Look for something with a given solr ID
      SchemaField uniqueKey = schema.getUniqueKeyField();
      String v = uniqueKey.getType().toInternal( params.get(ID) );
      Term t = new Term( uniqueKey.getName(), v );
      docId = searcher.getFirstMatch( t );
      if( docId < 0 ) {
        throw new SolrException( SolrException.ErrorCode.NOT_FOUND, "Can't find document: "+params.get( ID ) );
View Full Code Here

Examples of org.hivedb.meta.persistence.IndexSchema

  public static void install(PartitionDimension partitionDimension) {
    for (TableInfo table : getTables(partitionDimension)) {
      createTable(table, partitionDimension.getIndexUri());
    }
    if (indexSchemas.get(partitionDimension.getIndexUri()) == null) {
      indexSchemas.put(partitionDimension.getIndexUri(), new IndexSchema(partitionDimension));
    }
  }
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.