[Yazlist] Metaproxy vs Solr

Adam Dickmeiss adam at indexdata.dk
Tue Oct 2 08:54:26 UTC 2012


On 10/02/2012 10:40 AM, Adam Dickmeiss wrote:
> On 09/20/2012 12:39 PM, Porst, Sven wrote:
>> Dear list,
>>
>> I’m really enjoying the fact that Metaproxy supports querying Solr 
>> indexes but I am struggling to use that feature together with some of 
>> Metaproxy’s other powerful features. It’d be great if someone with 
>> more experience configuring the software could shed some light on 
>> whether or not the things I am trying to do are possible at all (and, 
>> if so, how).
>>
>> I successfully managed to use Metaproxy for creating a SRU interface 
>> to Solr indexes. Now I have a case where I’d like Metaproxy to 
>> transparently add an additional search condition to the query when 
>> processing it. It seems that Metaproxy’s query_rewrite filter is the 
>> tool for that task and I created an XSL to modify the query the way I 
>> want.
>>
>> I inserted the  query_rewrite into my route [1] to create this:
>>
>> * frontend_net
>> * sru_z3950
>> + query_rewrite
>> * zoom
>> * bounce
>>
>> With that setup I get an error:
>>
>>> searchResponse Failure DIAG 108 "converion from Query to XML failed"
> The problem is that you are probably passing CQL to query_rewrite and 
> it only accepts RPN.
If the query_rewrite you'd like to do is CQL-based, then, perhaps the 
query rewrite filter should be extended for CQL type of queries. That 
would solve your problem too. Query rewrite, thus, would be the same for 
all targets.

/ Adam
>> So I tried adding the cql_rpn filter as well, giving:
>>
>> * frontend_net
>> * sru_z3950
>> + cql_rpn (using metaproxy/etc/cql2pqf.txt)
>> * query_rewrite
>> * zoom
>> * bounce
>>
>> This converts my query to RPN
> Yes. That makes query_rewrite happy.. But when RPN is received at 
> zoom, that is passed verbatim . No CQL or CCL maps are in effect in 
> ZOOM, then. The RPN to SOLR conversion inside ZOOM will fail when it 
> gets a numeric use attribute.
>
> You could turn all things around and have a model where ONLY RPN is 
> accepted at ZOOM and no CQL/CCL maps at all. And the RPN would depend 
> on the target itself.. You'd have a cql_rpn - per target and a 
> query_rewrite - per target.. Something like
>   frontnet_net
>   sru_z3950
>   virt_db  - with route per target (or at least one per type).
>
> <virtual route="solr">
> <database>solrdb1</database>
> </virtual>
> <virtual route="solr">
> <database>solrdb2</database>
> </virtual>
> <virtual route="other">
> <database>otherdb</database>
> </virtual>
>
>
> And have separate route per type.. The important part is that the RPN 
> that goes through the Solr uses - at least numeric use attributes .. 
> It also allows you have a per target query rewrite.
>
> route:solr
>   cql_rpn
>   query_rewrite
>   zoom
>
> route:other
>   cql_rpn
>   query_rewrite
>   zoom
>
> / Adam
>
>>
>>> Z3950 searchRequest zvdd default XML CQL hilbert
>>> Z3950 searchRequest zvdd default XML RPN @attrset Bib-1 @attr 1=1010 
>>> @attr 5=100 @attr 6=1 @attr 3=3 @attr 4=1 @attr 2=3 hilbert
>>
>> but then fails to query the Solr Index showing
>>
>>> SRW diagnostic info:srw/diagnostic/1/2
>>> Message: System temporarily unavailable
> Target must have been pretty upset by this!
>> in yaz-client. Interestingly leaving out the query_rewrite step, to 
>> rule out that I'm messing the query up with my XSL, i.e.
>>
>> * frontend_net
>> * sru_z3950
>> * cql_rpn (using metaproxy/etc/cql2pqf.txt)
>> * zoom
>> * bounce
>>
>> does not seem to work either, but gives a different error message:
>>
>>> SRW diagnostic info:srw/diagnostic/1/10
>>> Message: Query syntax error
>>> Details: can not convert from RPN to CQL/SOLR
> Probably due to numerc use attributes.
>> What exactly could be the problem there? Do I need to supply 
>> additional configuration information for the zoom filter? If so, which?
>>
>> Best
>>
>>     Sven
>>
>> P.S. It seems the documentation for query_rewrite erroneously uses
>>> <xslt>pqf2pqf.xsl</xslt>
>
> Good spot. Thanks.
>
> / Adam
>> in its example while the schema and the software itself require this
>>> <xslt stylesheet="pqf2pqf.xsl"/>
>>
>>
>> [1] full configuration file before I started to mess with 
>> query_rewrite is available here:
>> https://github.com/ssp/metaproxy-SUB/blob/master/conf/SUB.xml
>>
>
>
> _______________________________________________
> Yazlist mailing list
> Yazlist at lists.indexdata.dk
> http://lists.indexdata.dk/cgi-bin/mailman/listinfo/yazlist
>




More information about the Yazlist mailing list