Preprocess Solr query

33 views
Skip to first unread message

Thang Chi Duong

unread,
Aug 31, 2013, 11:45:57 AM8/31/13
to lmf-...@googlegroups.com
Hi,

I want to implement the following feature leveraging LMF: let say I have defined that "Information technology" is a broader concept of "Computer science" and "Computer Engineering" using the provided SKOS editor.  Now, when the user searches for keyword "Information technology", the search engine will search for "Computer science" and "Computer Engineering" also since they are narrower concepts of "Information technology".
I contemplate that I need to implement a new feature which modifies the user query. In the above example, it will add two keywords "Computer Science" and "COmputer engineering" into the existing query.  First, it needs to identify "Information technology" as a predefined concept. Then, adding two subconcepts to the query. Finally, sending the modified query to the solr core.

Can you please show me some guidelines to implement this feature ? I have clone the LMF code and have a look at it but I don't know where to start.

Thank you,
Best,
Thang

Sergio Fernández

unread,
Sep 2, 2013, 2:30:02 AM9/2/13
to lmf-...@googlegroups.com, Thang Chi Duong
Hi,

On 31/08/13 17:45, Thang Chi Duong wrote:
> Hi,
>
> I want to implement the following feature leveraging LMF: let say I have
> defined that "Information technology" is a broader concept of "Computer
> science" and "Computer Engineering" using the provided SKOS editor. Now,
> when the user searches for keyword "Information technology", the search
> engine will search for "Computer science" and "Computer Engineering" also
> since they are narrower concepts of "Information technology".
> I contemplate that I need to implement a new feature which modifies the
> user query. In the above example, it will add two keywords "Computer
> Science" and "COmputer engineering" into the existing query. First, it
> needs to identify "Information technology" as a predefined concept. Then,
> adding two subconcepts to the query. Finally, sending the modified query to
> the solr core.

If I understood correctly, you wouldn't need to manually modify the solr
core, you just need to correctly tuning your core. Something like

category = dct:subject / (skos:broader)* / rdfs:label :: xsd:string ;

Then the semantic search engine will choose the label of any concept. As
in regex, the * selector means 0..n.

Further detail about the LDPath language and the wildcard selections at:

http://marmotta.incubator.apache.org/ldpath/language.html

Hope this helps.

Cheers,

--
Sergio Fern�ndez
Salzburg Research
+43 662 2288 318
Jakob-Haringer Strasse 5/II
A-5020 Salzburg (Austria)
http://www.salzburgresearch.at
Reply all
Reply to author
Forward
0 new messages