Hi,

I have an index with several collections. Every document has a collection 
field that specifies the collection it belongs to. To make querying easier 
(and restrict exposed parameters) i have a request handler for each 
collection. The request handlers are largely the same and preset all 
parameters using invariants.

Well, this is all very nice. But there is a catch, i cannot make an invariant 
of the fq parameter because it's being used (from the outside) to navigate 
through the facets. This means that the outside world can specify any value 
for the fq parameter.

With the fq parameter being exposed, it is possible for request handler X to 
query documents that belong to collection Y and vice versa. But, as you might 
guess by now, request handler X should only be allowed to retrieve documents 
that belong to collection X.

I know there are some discussions on how to restrict users to certain 
documents but i'd like to know if it is doable to patch the request handler 
logic to add an invariant-like directive that allows me to restrict a certain 
value for a certain parameter, but allow different values for that parameters.

To give an example:

<requestHandler name="collection_x">
<lst name="invariants">
<str name="defType">dismax</str>
... More invariants here
</lst>

<lst name="what_should_we_call_this?">
<str name="fq">fieldName:collection_x</str>
</lst>
</requestHandler>

The above configuration won't allow to change the defType and won't allow a 
value to be specified for the <fieldName> through the fq parameter. It will 
allow the outside worls to specify a value on another field through the fq 
parameter such as : fq:anotherField:someValue.

Any ideas? 


Cheers,

Markus Jelsma - Technisch Architect - Buyways BV
http://www.linkedin.com/in/markus17
050-8536620 / 06-50258350

Reply via email to