In general, a browse or search session may include various constraints, such as the search query entered by the user; a range of dates a result should match; excluded key words etc.

eg:

var s := search ForumPost matching title, content: userQuery
...
~s matching title, content: -notQuery
...
~s matching postDate: [* TO maxDate]

With the current implementation of the search language, we can only extract the main query (userQuery) from the searcher object. If the notQuery and date range need to be presented elsewhere, we need to pass the non-main-query constraint values.
It would be nice if we can name the different constraints, such that we can retrieve them from the searcher instance later on.

Something like this:

var s := search ForumPost matching title, content: userQuery@mq
...
~s matching title, content: -notQuery@nq
...
~s matching postDate: [* TO maxDate]@rq

... new page request...

"query: " output(searcher.getQuery(mq))
"excluded keywords: " output(searcher.getQuery(nq))
"post date: " output(searcher.getQuery(rq))
Submitted by Elmer van Chastelet on 22 February 2013 at 12:56

On 22 February 2013 at 12:56 Elmer van Chastelet tagged search

Log in to post comments