Search2 Optimisation

From KnowledgeTree Community

Jump to: navigation, search

By constructing complex search expressions, the system may suffer a performance hit.

The performance hit occurs mainly when the expression evaluator has to identify subexpressions that must run on the database and those that must run on Lucene. The evaluator attempts to evaluate as many subexpressions that are possible on each system (db or lucene), without breaking the meaning of the expression.

There are some techniques that can be applied to improve performance.

1) attempt to group the database fields closer to one another

2) attempt to group the full text fields closer to one another

3) minimise complex expressions where there are

The evaluator has 'space' for a 'query planner' that in future can minimise the impact of complex queries, but it is fairly simple at this stage and thus users are advised to be aware of this possible impact.

Example

(DocumentText contains "hello World") and (Filesize <= "100") and (DiscussionText contains "world") and (title contains "hello")

is best rephrased as:

(DocumentText contains "hello World" and DiscussionText contains "world") and (Title contains "hello" and Filesize <= "100")

Visualising Script Impact

TODO: where did I put it?

On Unix/Linux, the GraphViz library may be used to visualise the search expression tree and how it is likely to be evaluated. Using this script you can modify your search expression to be more optimal.

Personal tools