lucy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zebrowski, Zak" <>
Subject RE: [lucy-user] How to add more languages in an analyzer and change path to store indexed documents
Date Wed, 13 Jun 2012 19:48:18 GMT
#my $polyanalyzer = Lucy::Analysis::PolyAnalyzer->new(
 #      language => 'en',
 #     )
#How can I specify multiple languages such as Danish, German, Finnish etc

Use the appropriate 2 letter country code from the polyanalyzer perldoc, eg:
    en => English,
    da => Danish,
    de => German,
    es => Spanish,
    fi => Finnish,
    fr => French,
    hu => Hungarian,
    it => Italian,
    nl => Dutch,
    no => Norwegian,
    pt => Portuguese,
    ro => Romanian,
    ru => Russian,
    sv => Swedish,
    tr => Turkish,

or you can create your own polyanalyzer, which I do.

#Secondly the path_to_index given in the tutorial is '/store/lucy_test'.
#This path was given in the sample tutorial when I downloaded the
#apache-lucy-0.3.1 library. Now if I want to change this path meaning I want
#to store my indexed documents at a different location how can I do that?

Just set it.    Update the path to the path structure you want to use.  There's nothing special
here.  Just make sure the directory structure exists before you start creating your index.

#Also what do the 'create'  and 'truncate' parameters specify in this case?

Create simply creates an index if it doesn't exist.  " truncate - If true, proceed with the
intention of discarding all previous indexing data. The old data will remain intact and visible
until commit() succeeds. "  (See :

When you have questions about a particular perl module, (for an object which you're using),
look at the perldoc for that module for more information beyond that which is contained in
the walk through.

# *Index doesn't seem to contain any data*

After you generate your index, be sure to call $indexer->commit(); otherwise, there will
be no documents found.  Then, make sure that your cgi has permission to read the index directory
structure.  If you don't have read permissions, it will appear to the cgi that no index was

Good luck.

View raw message