Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated for new index command names

...

Command used:

[dspace]/bin/dspace index-lucene-init

Java class:

org.dspace.browse.IndexBrowse

Arguments short and long forms):

Description

-r or -rebuild

Should we rebuild all the indexes, which removes old tables and creates new ones. For use with -f. Mutually exclusive with -d

-s or -start

-s <int> start from this index number and work upwards (mostly only useful for debugging). For use with -t and -f

-x or -execute

Execute all the remove and create SQL against the database. For use with -t and -f

-i or -index

Actually do the indexing. Mutually exclusive with -t and -f.

-o or -out

-o <filename> write the remove and create SQL to the given file. For use with -t and -f

-p or -print

Write the remove and create SQL to the stdout. For use with -t and -f.

-t or -tables

Create the tables only, do no attempt to index. Mutually exclusive with -f and -i

-f or -full

Make the tables, and do the indexing. This forces -x. Mutually exclusive with -f and -i.

-v or -verbose

Print extra information to the stdout. If used in conjunction with -p, you cannot use the stdout to generate your database structure.

-d or -delete

Delete all the indexes, but do not create new ones. For use with -f. This is mutually exclusive with -r.

-h or -help

Show this help documentation. Overrides all other arguments.

...

Warning
titleRequires that you stop Tomcat first

Because this command actually deletes existing Browse Index tables, you must stop Tomcat (or your Servlet Container of choice) before executing index-lucene-init. After the indexing command completes, you can restart Tomcat.

Warning
titleKnown Oracle Issues

In many Oracle based DSpace installations, index-lucene-init often malfunctions because of Oracle specific permissions. It is therefore advised to stick to index-lucene-update instead

By running [dspace]/bin/dspace index-lucene-init you will completely regenerate your indexes, tearing down all existing tables and reconstructing with the new configuration.

Code Block
[dspace]/bin/dspace index-lucene-init

 

Updating the Indexes

By running [dspace]/bin/dspace index-lucene-update you will reindex your full browse & search indexes without modifying the DSpace table structure. (This should be your default approach if indexing, for example, via a cron job periodically). Because it does not "tear down" the existing tables, this command can be run while DSpace (and Tomcat or similar) is still running.

Code Block
[dspace]/bin/dspace index-lucene-update
Warning

If you are using the Solr Browse DAOs, that is the default since DSpace 4.0, you don't need to run this script as the data are stored in the Solr search core. You need to recreate the indexes using the Discovery maintenance script

...

Code Block
[dspace]/bin/dspace index-db-browse -r -t -p -v -x -o myfile.sql

...

Because Browse Indexes are stored in database tables, remember to run index-lucene-init after adding any new definitions in the dspace.cfg to have the indexes created and the data indexed.

...

Search indexes can be configured and customized easily in the dspace.cfg file. This allows institutions to choose which DSpace metadata fields are indexed by Lucene.

Property:

search.dir

Example Value:

search.dir = ${dspace.dir}/search

Informational Note:

Where to put the search index files

Property:

search.max-clauses

Example Value:

search.max-clauses = 2048

Informational Note:

By setting higher values of search.max-clauses will enable prefix searches to work on larger repositories.

Property:

search.index.delay

Example Value:

search.index.delay = 5000

Informational Note:

It is possible to create a 'delayed index flusher'. If a web application pushes multiple search requests (i.e. a barrage or sword deposits, or multiple quick edits in the user interface), then this will combine them into a single index update. You set the property key to the number of milliseconds to wait for an update. The example value will hold a Lucene update in a queue for up to 5 seconds. After 5 seconds all waiting updates will be written to the Lucene index.

Property:

search.analyzer

Example Value:

search.analyzer = org.dspace.search.DSAnalyzer

Informational Note:

Which Lucene Analyzer implementation to use. If this is omitted or commented out, the standard DSpace analyzer (designed for English) is used by default. This standard DSpace analyzer removes common stopwords, lowercases all words and performs stemming (removing common word endings, like "ing", "s", etc).

Property:

search.analyzer

Example Value:

search.analyzer = org.dspace.search.DSNonStemmingAnalyzer

Informational Note:

Instead of the standard DSpace Analyzer (DSAnalyzer), use an analyzer which doesn't "stem" words/terms. When using this analyzer, a search for "wellness" will always return items matching "wellness" and not "well". However, similarly a search for "experiments" will only return objects matching "experiments" and not "experiment" or "experimenting". When using this analyzer, you may still use WildCard searches like "experiment*" to match the beginning of words.

Property:

search.analyzer

Example Value:

search.analyzer = org.apache.lucene.analysis.cn.ChineseAnalyzer

Informational Note:

Instead of the standard English analyzer, the Chinese analyzer is used.

Property:

search.operator

Example Value:

search.operator = OR

Informational Note

Boolean search operator to use. The currently supported values are OR and AND. If this configuration item is missing or commented out, OR is used. AND requires all the search terms to be present. OR requires one or more search terms to be present.

Property:

search.maxfieldlength

Example Value:

search.maxfieldlength = 10000

Informational Note:

This is the maximum number of terms indexed for a single field in Lucene. The default is 10,000 words‚ often not enough for full-text indexing. If you change this, you will need to re-index for the change to take effect on previously added items. -1 = unlimited (Integer.MAG_VALUE)

Property:

search.index. n

Example Value:

search.index.1 = author:dc.contributor.*

Informational Note

This property determines which of the metadata fields are being indexed for search. As an example, if you do not include the title field here, searching for a word in the title will not be matched with the titles of your items..

...

After changing the configuration run /[dspace]/bin/dspace index-lucene-init to regenerate the indexes.

...

Although DSIndexer automatically builds a separate index for the authority keys of any index that contains authority-controlled metadata fields, the "Advanced Search" UIs does do not allow direct access to it. Perhaps it will be added in the future. Fortunately, the OpenSearch API lets you submit a query directly to the Lucene search engine, and this may include the authority-controlled indexes.

...

XML UI requires manual coding of the involved templates instead the JSP UI provides specific configuration to set the index to show in the advanced search dropdown. Below are listed the configuration parameters

Property:

jspui.search.index.display.<n>

Example Value

          jspui.search.index.display.1 = ANY

Informational Note:

Set the N-value of the index dropdown in the advanced search form. The value must match one of the defined index