cancel
Showing results for 
Search instead for 
Did you mean: 

[Lucene] Same query returns different results

damiar
Champ in-the-making
Champ in-the-making
Hi!

I'm having a strange behavior with a Lucene query… The problem is that if I execute a query I get some results, but if I execute the query AGAIN it returns differents results!

I mean:


logger.log('query:' + q);
var searchResults = search.luceneSearch(q);
for each (s in searchResults) {
   logger.log(s.name + ' - ' + s.properties['jwtti:comment']);
}

Console displays:

query: +PATH:"/app:company_home/cm:assetsLibrary/cm:comm_4370/cm:assets/*" AND (@cm\:name:"*mojoja*" OR @cm\:title:"*mojoja*" OR @cm\:description:"*mojoja*" OR @cm\:creator:"*mojoja*" OR @jwtti\:type:"*mojoja*" OR @jwtti\:referenceNumber:"*mojoja*" OR @jwtti\:comment:"*mojoja*" OR @jwtti\:application:"*mojoja*")

info.png - mojoJAEJAE
AlfrescoLogo32.png - mojojaja
goto.png - mojojaJA

And this is ok, because Lucene is matching fine…

But in some cases when I execute the query I get this:

query: +PATH:"/app:company_home/cm:assetsLibrary/cm:comm_4370/cm:assets/*" AND (@cm\:name:"*mojoja*" OR @cm\:title:"*mojoja*" OR @cm\:description:"*mojoja*" OR @cm\:creator:"*mojoja*" OR @jwtti\:type:"*mojoja*" OR @jwtti\:referenceNumber:"*mojoja*" OR @jwtti\:comment:"*mojoja*" OR @jwtti\:application:"*mojoja*")

ascii.png - mojojeje
cdbo_list.png - mojojiji
colorscm.png - mojojuju
info.png - mojoJAEJAE
gaim.png - mojojojo
AlfrescoLogo32.png - mojojaja
goto.png - mojojaJA

Any help? This is really strange!
3 REPLIES 3

damiar
Champ in-the-making
Champ in-the-making
Oh, I forgot to mention that if I copy and paste the query in the node browser it always works fine.

damiar
Champ in-the-making
Champ in-the-making
And… I'm using Alfresco Labs 3 beta

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

First, it is possible to get more results with subsequent queries due to permission caching.

Is your data changing?
Are any of your types d:content or set to index asynchronously?
If so they can start to show up at any time.

The index is reda committed so you will see changes committed from other transactions.

Andy