[chandler-users] /find syntaxes

Andi Vajda vajda at osafoundation.org
Tue Mar 11 11:50:54 PDT 2008


On Tue, 11 Mar 2008, Marcelo de Moraes Serpa wrote:

> Hello Andi, thanks for replying.
>
> The use of the StandardAnalyzer here is a little iffy and should be changed
>> to one more adapted to your locale. That being said, it would still most
>> likely strip off the '@' unless that was explicitely changed too.
>>
>
> How to change to one more adapted to my locale (pt_br)?

Pick the Lucene analyzer compatible with Brazilian Portuguese.
Such as the one at [1]. PyLucene, which Chandler uses for its full text 
search needs, comes with the BrazilianAnalyzer built in.
You may want to experiment with combining that analyzer with a 
LetterAnalyzer or the StandardFilter to see what best suits your needs.

> And is there a way to change it without modifying the original source code?
> (Something like Zope's 3 component architecture).

I'm afraid not. The code should be changed to at least use a preference or 
base its analyzer choice on the current locale. In the meantime, If you 
change analyzers, to be complete, you also need to get chandler to reindex 
your data (changing the analyzer in the indexing code too, all in 
LuceneContainer.py in the chandlerdb egg). To get chandler to reindex your 
data, press the control key while Chandler is starting and pick the relevant 
option from the dialog. Or, from the command line, start Chandler with 
--reset-index.

Andi..

[1] http://hudson.zones.apache.org/hudson/job/Lucene-trunk/javadoc//org/apache/lucene/analysis/br/package-summary.html

>
> On Tue, Mar 11, 2008 at 2:19 PM, Andi Vajda <vajda at osafoundation.org> wrote:
>
>>
>> On Tue, 11 Mar 2008, Marcelo de Moraes Serpa wrote:
>>
>>> Hello fellow Chandler users and developers,
>>>
>>> I'm trying to search for exactly the "@home" string and not "home".
>>> Coincidently, there are some entries in my Chandler repo. that contain
>> the
>>> "home" word and they are retrieved when I search for @home using /find
>>> @home. How could I search for entries containing exatclty the "@home"
>>> string?
>>
>> The analyzer used to tokenize your query strips off the '@' sign.
>>
>>  >>> QueryParser("contents", StandardAnalyzer()).parse("@home")
>>   <Query: contents:home>
>>
>> The use of the StandardAnalyzer here is a little iffy and should be
>> changed
>> to one more adapted to your locale. That being said, it would still most
>> likely strip off the '@' unless that was explicitely changed too.
>>
>> Andi..
>>
>>
>> _______________________________________________
>> chandler-users mailing list
>> chandler-users at osafoundation.org
>> http://lists.osafoundation.org/mailman/listinfo/chandler-users
>>
>


More information about the chandler-users mailing list