How to optimize solr indexes

2019-08-27 02:13发布

问题:

when i run solr/admin page i got this information, it shows optimize=true, but i have not set optimize=true in configuration file than how it is optimizing the indexes. and how can i set it to false then .

Schema Information

    Unique Key: UID_PK

    Default Search Field: text

    numDocs: 2881

    maxDoc: 2881

    numTerms: 41960

    version: 1309429290159

    optimized: true

    current: true

    hasDeletions: false

    directory: org.apache.lucene.store.SimpleFSDirectory:org.apache.lucene.store.SimpleFSDirectory@ C:\apache-solr-1.4.0\example\example-DIH\solr\db\data\index

    lastModified: 2011-06-30T10:25:04.89Z

回答1:

It doesnt say "optimize = true" or that it will "optimize something". It says that your index is currently optimized. Thats a difference it describes only the current status of your index.

The best way to lookup this kind of thing is:

  1. Insert a couple of rows
  2. Lookup this value it will show "optimized"
  3. Delete a row
  4. Lookup again this value it will say "not optimized"