AnsweredAssumed Answered

Query Lucece one time with result and one time no?

Question asked by razieltd on Nov 17, 2010
Latest reply on Nov 26, 2010 by razieltd
Hi!  :)

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());

Outcomes