cancel
Showing results for 
Search instead for 
Did you mean: 

Indexing option, luceneSearch sort option

serverok
Champ in-the-making
Champ in-the-making
I have the question:

1) in the WiKi (http://wiki.alfresco.com/wiki/Full-Text_Search_Configuration) we have this info:
The indexing behaviour of each property can be set in the content model. By default, they are indexed atomically. The property value is not stored in the index, and the property is tokenised when it is indexed.
If I understand correctly by default the indexing is enabled also is enabled a tokenisation.

2) the lucene Search have this condition to the field which we use for sorting (http://lucene.apache.org/java/2_3_2/api/org/apache/lucene/search/Sort.html😞
The field must be indexed, but should not be tokenized, and does not need to be stored (unless you happen to want it back with the rest of your document data).

3) I installed alfresco, imported information and forced a full reindex. In the contentModel.xml the "cm:title" field use default indexing options - don't have the <index></index> section. From #1 -> this field is indexed and tokenised.

Then WHY I can sort result by "cm:title" in the luceneSearch?
2 REPLIES 2

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

It is possible to order at the moment it just will not always be right (as it will use the tokens - so anything containing any token starting with "a" will be near the top …).
In some cases lucene may complain.

This is a trade off between FTS search and ordering.
In later versions we support FTS and ordering for some properties (like name). Then ordering and FTS will both be correct.

There are now more options for tokenisation in the property definition in the data dictionary.
"both" supports ordering and FTS.

Andy

serverok
Champ in-the-making
Champ in-the-making
Thank you Andy for your answer.

But we have encountered with these two questions:
1) What is the best/fastest method to correctly sort lucene results by properties that contain multiple tokens?  Is the only choice to sort "manually" in the web script after running the lucene query without sorting?

2) Can you tell us more specifically which versions when you said  "In later versions we support FTS and ordering for some properties (like name)"?