You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by zackko <gs...@omnifone.com> on 2010/09/20 14:32:50 UTC

Solr Analyzer results before the actual query.

Hi to all the Forum from a new subscriber,

I’m working on the Server Side Search solution of the Company when I’m
currently employed with. I have a problem at the moment: When I will submit
a search to Solr I want to see the “Analyzer results”, with all the Filter
applied to it as defined into the types.xml, of the search terms (Query)
submitted to the Analyzer itself. The result of the Analyzer I want to have
displayed BEFORE the actual search will be performed so I can decide at this
point if I can run the proper search or leave the user with no results on
the search performed.
 
The problem is more less described in that issue
https://issues.apache.org/jira/browse/SOLR-261. In summary is that possible
to have the Analyzer results (in code) before running the actual Sorl
search?

I'm quite new to Solr so maybe this issue has been already discussed in
another thread but I'm unable to find it at the moment, so if anybody has a
any clue on how to do that please any suggestion will be more than welcome.
 
Thanks very much in advance for your answer.
 
Best wishes.

-- 
View this message in context: http://lucene.472066.n3.nabble.com/Solr-Analyzer-results-before-the-actual-query-tp1528692p1528692.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr Analyzer results before the actual query.

Posted by zackko <gs...@omnifone.com>.
OK I've found that all the definitions for the Admin application are inside
_info.jsp (inside <solr-source-folder>\src\webapp\web\admin\ ). Now I will
need to figure out how to make it working in a Java class...

I'll keep you posted...

By now thanks for the tips.

Best wishes.

-- 
View this message in context: http://lucene.472066.n3.nabble.com/Solr-Analyzer-results-before-the-actual-query-tp1528692p1555464.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr Analyzer results before the actual query.

Posted by zackko <gs...@omnifone.com>.
Hi Lance,

Thanks for the prompt reply. Looking at the analysis.jsp in the Solr release
that is the code I should look at:

 private static void doAnalyzer(JspWriter out, SchemaField field, String
val, boolean queryAnalyser, boolean verbose, Set<Tok> match) throws
Exception {

    FieldType ft = field.getType();
     Analyzer analyzer = queryAnalyser ?
             ft.getQueryAnalyzer() : ft.getAnalyzer();
     if (analyzer instanceof TokenizerChain) {
  
          .................
}

and then it applies all the Filters in sequence as described into the XML
file inside the SOlR folder (types.xml).

The problem is that looking backward I couldn't find where the SchemaField
field (the actual variable that I'm investigating) is coming from. In the
JSP itself there is:

        field = schema.getField(name);

that I suppose "schema" is the actual object holding the variables
description (types.xml). The problem is that I'm unable to find where this
object is defined and that is essential to retrieve the Filters applied to
that variable.

Where can be a good place to look for it?!?

Thanks for your patience and in advance for the reply.

Best wishes.
-- 
View this message in context: http://lucene.472066.n3.nabble.com/Solr-Analyzer-results-before-the-actual-query-tp1528692p1534337.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr Analyzer results before the actual query.

Posted by Lance Norskog <go...@gmail.com>.
Yes. Look at the jsp page solr/admin/analysis.jsp . This does calls to 
Solr which do exactly what you want. They use the AnalysisComponent.

Lance

zackko wrote:
> Hi to all the Forum from a new subscriber,
>
> I’m working on the Server Side Search solution of the Company when I’m
> currently employed with. I have a problem at the moment: When I will submit
> a search to Solr I want to see the “Analyzer results”, with all the Filter
> applied to it as defined into the types.xml, of the search terms (Query)
> submitted to the Analyzer itself. The result of the Analyzer I want to have
> displayed BEFORE the actual search will be performed so I can decide at this
> point if I can run the proper search or leave the user with no results on
> the search performed.
>
> The problem is more less described in that issue
> https://issues.apache.org/jira/browse/SOLR-261. In summary is that possible
> to have the Analyzer results (in code) before running the actual Sorl
> search?
>
> I'm quite new to Solr so maybe this issue has been already discussed in
> another thread but I'm unable to find it at the moment, so if anybody has a
> any clue on how to do that please any suggestion will be more than welcome.
>
> Thanks very much in advance for your answer.
>
> Best wishes.
>
>