cancel
Showing results for 
Search instead for 
Did you mean: 

Query parser eats last character

dooman
Champ in-the-making
Champ in-the-making
I have some problem with lucene query. I query content with the next parameters:

        SearchParameters searchParameters = new SearchParameters();
        searchParameters.setLanguage(SearchService.LANGUAGE_LUCENE);
        searchParameters.addLocale(new Locale("ru", "RU"));
        searchParameters.setQuery(query);
        searchParameters.setMlAnalaysisMode(MLAnalysisMode.EXACT_LANGUAGE);
where query = +TYPE: "dmsSmiley Tongueosition" AND (@cm\:name:"[ново*]")

But I got wrong results. The result has all dmsSmiley Tongueosition where cm:name contains "нов*". I turned on debug for org.alfresco.repo.search.impl.lucene.LuceneQueryParser and see the next log:

12:06:17,410 User:admin DEBUG [impl.lucene.LuceneQueryParser] Query +TYPE: "dms:position" AND (@cm\:name:"[ново*]")                             is
   +(TYPE:{http://www.korusconsulting.ru/dms}position) +(@{http://www.alfresco.org/model/content/1.0}name:нов*)

Should I create new bug report?

Alfresco version: 3.4.e.
5 REPLIES 5

andy
Champ on-the-rise
Champ on-the-rise
Hi

The phrase wildcard includes stemming. It would appear that the Russain analyser is removing this character.
You can change the tokenizer.

What is the repository/Java locale? If it is not "ru_RU" you are probably having issues with cross-language support.

The best resolution for you will be to configure only one analyser for all locales, and reindex.
Or, add more locales to the query to support cross-locale querying

Andy

dooman
Champ in-the-making
Champ in-the-making
Hi

The phrase wildcard includes stemming. It would appear that the Russain analyser is removing this character.
You can change the tokenizer.

What is the repository/Java locale? If it is not "ru_RU" you are probably having issues with cross-language support.

The best resolution for you will be to configure only one analyser for all locales, and reindex.
Or, add more locales to the query to support cross-locale querying

Andy

Thank you for answer.

I didn't make any changes to lucene configuration. How I can set analyzer for all locales? I try to set it in dictionaryModel.xml, but had not success result Smiley Sad

andy
Champ on-the-rise
Champ on-the-rise
Hi

You need to remove all the files like:

alfresco/model/dataTypeAnalyzers_cs.properties

from the deployed web app an leave only

alfresco/model/dataTypeAnalyzers.properties

In this file specify the analysis you want to apply to all languages

Cross-language support (SOLR only) and analysis configuration is muched improved in the next release of Alfresco.

Andy

dooman
Champ in-the-making
Champ in-the-making
Hi

You need to remove all the files like:

alfresco/model/dataTypeAnalyzers_cs.properties

from the deployed web app an leave only

alfresco/model/dataTypeAnalyzers.properties

In this file specify the analysis you want to apply to all languages

Cross-language support (SOLR only) and analysis configuration is muched improved in the next release of Alfresco.

Andy

Thank you, Andy. Your answers are very helpful for me!

clementus
Champ in-the-making
Champ in-the-making
Thanks Andy…