cancel
Showing results for 
Search instead for 
Did you mean: 

Use of indexes in a query (with SOLR)

spilby
Confirmed Champ
Confirmed Champ
I have a doubt about how indexed properties works in Alfresco 4.1.6 with SOLR.

I use something like this for my queries:


SearchParameters sp = new SearchParameters();
sp.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
sp.setLanguage(SearchService.LANGUAGE_FTS_ALFRESCO);
sp.setQuery(query);
ResultSet results = getSearchService().query(sp);


where query variable is something like this:


PATH:" /app:company_home/app:user_homes/cm:_x0030_123//*" AND ((@cm\:title:food) OR (@cm\:name:abcde) OR (TEXT:valles) OR (@doc\:custom_property:"report") OR (@doc\:custom_property2:"report") AND (@doc\:custom_property3:"report") AND TYPE:"{my.model}voc_document"


On my model.xml I specify what custom properties are indexed (
<index enabled="true">
)

I use Alfresco 4.1.6 with SOLR. My question is… How works SOLR with the indexes if I put on the search query two or more indexed properties? Like Oracle? Oracle try the best index and use only this. Or maybe SOLR combine all the indexed properties and uses all the index on the query? 

I need this answer to determine how many indexes put on my model.xml. Maybe put a lot of indexes don't give me the best and efficient result and is better index only a few properties.

And finally, one question… I use SearchService.LANGUAGE_FTS_ALFRESCO, but I can see that exists a earchService.LANGUAGE_SOLR_FTS_ALFRESCO. Is the same? I need to use the second if I use SOLR?

Thanks a lot!

Best regards


3 REPLIES 3

mrogers
Star Contributor
Star Contributor
SOLR4 is very good at indexing properties.  Don't worry about it.   And don't think of them as oracle indexes.

spilby
Confirmed Champ
Confirmed Champ
Ok, but… I imagine is not the same declare a lot of index on the model, or a few. Maybe exceed number of indexs affect negatively the performance.

What's your recommendation? Index all the properties that I use on the search queries, and make queries with ANDs and multiple indexes? Or only works with few indexes and use one by query?

mrogers
Star Contributor
Star Contributor
Let SOLR do the work.  Its very good!   Probably much better than trying to code it yourself.