AnsweredAssumed Answered

Document Search Result Mismatch

Question asked by swemon on May 2, 2012
Latest reply on May 2, 2012 by andy
Dear all,

I want to use search service to retrieve documents in repository like alfresco search page.
like this
SearchParameters sp = new SearchParameters();
            sp.addStore(new StoreRef(REPOSITORY_STOREREF)); //"workspace://SpacesStore"
            sp.setLanguage(SearchService.LANGUAGE_LUCENE);
            String query = documentNameParam + " AND TYPE:\"content\""; // filename AND TYPE:"content"
            sp.setQuery(query);
            ResultSet resultSet = null;
            try
            {
               System.out.println("NodeRef meeting for search critria…: " + sp.getQuery());
               resultSet = searchService.query(sp);
                for(ResultSetRow row : resultSet)
                {
                   System.out.println("NodeRef: " + row.getNodeRef());
                   documentNodeRefs.add(row.getNodeRef());
                }
            }
            finally
            {
                if(resultSet != null)
                {
                   resultSet.close();
                }
            }

When I use same query, this code will not show any correct result but not always while searching with alfresco search page shows correct results.

Any ideas? Is there any restriction for document in search service???

Outcomes