Hi David,
Zend_Search_Lucene doesn't support subqueries now.
I work on subqueries just now.
Until it's not done only multiterm query may be used to filter query
result by some fields:
+userterm1 +userterm2 +url:support +url:knowledgebase
If url field is not tokenized, but contains several separated words
(like "/support/knowledgebase/"), than query must be constructed through
API. Queryparser will tokenize +url:/support/knowledgebase and treat it
as +url:support knowledgebase.
Or you should construct your own query parser, which doesn't treats '/'
as non-letter or digit.
With best regards,
Alexander Veremyev.
David Brännlund wrote:
Hi everyone,
I'm trying to implement a way to be able to select only parts of our
website to search. For instance "Restrict your search to Support
Knowledge Base...". I have a field called url that I can use to select
only pages with the address /support/knowledgebase/, but I'm having
problems combining that with the rest of the search terms.
What I want is to have a query string like "+(user's search terms)
+url:/support/...", but that don't have the affect that I expect. The
problem is that all pages matching the url are returned, whatever the
user has entered. The user's search terms only affect the order of
appearance.
One way to solve it would be to build separate indexes for each part,
but I would rather solve it using the same index. Has anyone tried this
before?
Thanks,
David Brännlund
Web & Database Development
COMSOL AB, Sweden