cancel
Showing results for 
Search instead for 
Did you mean: 

Query Lucece one time with result and one time no?

razieltd
Champ in-the-making
Champ in-the-making
Hi!  Smiley Happy

i have this strange problem:
i have extended my alfresco 3.1 with a new very simple servlet. This servlet have a start jsp form where can i change the basic lucene's query and a result jsp with pagination.
so i do my search and i obtain my results (32) and then i go back to the form page(direct link to the jsp, no button back of explorer or mozilla) and restart the same research but i obtain zero result! how it is possible? the realy strange thing is that after the zero results i copy the query and paste in the node browser i obtain again the zero results!!! how if the alfresco is freeze o something like that! after 4-5 times of seraching i obtain again my 32 results!

this is the code:
            logger.debug("Query Lucene: "+query);
            StoreRef storeRef= StoreRef.STORE_REF_WORKSPACE_SPACESSTORE;
            SearchParameters parameters=new SearchParameters();
            parameters.addStore(storeRef);
            parameters.setLanguage(SearchService.LANGUAGE_LUCENE);
            parameters.setQuery(query);
            parameters.addSort("TYPE", true);
            if(fieldOrd!=null && !fieldOrd.equals("")){
                fieldOrd="@"+fieldOrd;
                parameters.addSort(fieldOrd, false);
            }
            ResultSet rs=searchService.query(parameters);
            List<NodeRef> list=rs.getNodeRefs();
System.out.println("n°: "+list.size());
12 REPLIES 12

derek
Star Contributor
Star Contributor
Are you doing a search that is likely to hit many results in Lucene, but as a user that only has access to a few of the documents?
If you perform the search as 'admin', do you expect to get 32 results as well?

razieltd
Champ in-the-making
Champ in-the-making
iam searching like a admin and i expect 32 results.
….. it is very strange  :?

andy
Champ on-the-rise
Champ on-the-rise
HI

What is your query?
Does the last modified date change on the nodes?

Is anything else going on that would affect your query results - cause the nodes metadata or content to change so they are reindexed  - and then may be you do not not have full text yet, or the next update to content indexes using a different content transform that produces different results - rules/actions could do this and possibly thumbnailing …..


Andy

razieltd
Champ in-the-making
Champ in-the-making
@Andy

Hi
no my base query is very simple! iam searching by PATH and 3 properties of type text. Now iam working on my pc and i am sure that this nodes arent modified.

so this is the Query Lucene:
PATH:"/app:company_home/cm:my_archive/cm:CatOne//*" AND +@arch\Smiley Tonguelace:"Venice" AND +@arch\Smiley Tonguelace_code:"16" AND +@arch\:desc_place:"canal"

arch is my custom model and work fine

razieltd
Champ in-the-making
Champ in-the-making
someone can help me?  :roll:

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

Does the node browser always give you consistent results?

Navigate to the nodes using the node browser and check the modified date.

How are these files added?
Are there any rules on the containing folder?


Andy

razieltd
Champ in-the-making
Champ in-the-making
Hi

no the node browser give me 0 result when my reaserch freez on zero result. if i restart alfresco and try again i obtain my results, i go to my form try the research and ok i see the results, back repeat the same research… booom 0 results  Smiley Surprised  go to nodebrowser…paste the same query 0 result. These steps for 4-5 times.

the modified date is the same when i have uploaded these files and these file are auploaded with the alfresco client and no ruls are apply on the space  :cry:

thx

derek
Star Contributor
Star Contributor
Is it repeatable it using the Node Browser only?

razieltd
Champ in-the-making
Champ in-the-making
no it hapen only with the servlet, with only nodebrowser no  :?