Issue Details (XML | Word | Printable)

Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: rsoika
Reporter: rsoika
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

Lucene Plugin -limit search result

Created: 08/May/12 08:51 PM   Updated: 17/Apr/13 06:46 AM   Resolved: 17/Apr/13 06:46 AM
Component/s: imixs-engine
Affects Version/s: 3.0.2
Fix Version/s: 3.1.1

Time Tracking:
Not Specified

Participants: rsoika

 Description  « Hide

We need a feature to limit the search result.
currently the serach retuns up to 1000 workitems. This can take a lot of time to load them from the database.

In lucene there seams to be a differnt betwenn serach(query,limit)
and the toDocs.scoreDocs.size()
We need to test this in detail.

some workarround:

// parser.setDefaultOperator(Operator.AND);
                TopDocs topDocs =,

                logger.fine("  total hits=" + topDocs.totalHits);

                // Get an array of references to matched documents
                ScoreDoc[] scoreDosArray = topDocs.scoreDocs;
                for (ScoreDoc scoredoc : scoreDosArray) {
                    // Retrieve the matched document and show relevant details
                    Document doc = searcher.doc(scoredoc.doc);

                    String sID = doc.get("$uniqueid");
                    logger.fine("  lucene $uniqueid=" + sID);
                    ItemCollection itemCol = workflowService.getEntityService()
                    if (itemCol != null) {
                    if (workitems.size()>=MAX_SEARCH_RESULT)

No work has yet been logged on this issue.