cancel
Showing results for 
Search instead for 
Did you mean: 

Query not return the result correctly

jlbarrera
Champ in-the-making
Champ in-the-making
This is the query:

ID:"workspace://SpacesStore/b96b72c1-c9f8-11da-984f-3d735fa1fd62" OR ID:"workspace://SpacesStore/b98674d6-c9f8-11da-984f-3d735fa1fd62" OR ID:"workspace://SpacesStore/b7ef5ad6-c9f8-11da-984f-3d735fa1fd62"

This query find 3 ID (unique for all Nodes) and the query will should return 3 Nodes, but the query return 9 !!

I i find in the query by 4 ID's, the query return 12 results!

Allways return 3 results for a ID.

This is the code:

RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();
String pathQuery="ID:\"" + idQuery.toString() + "\"" ;
Query queryCategory = new Query(QueryLanguageEnum.lucene, pathQuery);
QueryResult queryResultCat = repositoryService.query(STORE, queryCategory, false);
ResultSet resultSetCat = queryResultCat.getResultSet();
ResultSetRow rowsCat[] = resultSetCat.getRows();

Where idQuery is above.

Any ideas?
2 REPLIES 2

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

The index may contain several entries using ID (some internal structure to make path indexing better). So for folders you will get one entry for the node and as many more as there are unique paths to the folder.

You can solve your issue by

1) also looking for nodes +ISNODE:*

2) also looking for a specific type +TYPE:"cm:content"

See http://wiki.alfresco.com/wiki/Search
See http://wiki.alfresco.com/wiki/Search#Finding_Nodes_By_Type

I forgot to add this to the search documentation.

Regards

Andy

jlbarrera
Champ in-the-making
Champ in-the-making
OK Thanks! Now all worked fine  😎