Home | About | Sematext search-lucene.com search-hadoop.com
 Search Lucene and all its subprojects:

Switch to Threaded View
Solr, mail # user - accessing the analyzers in a component?


Copy link to this message
-
Re: accessing the analyzers in a component?
Paul Libbrecht 2011-03-15, 22:46
Thanks Ahmet, I indicated that in the wiki at
  http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters

My solution was a little bit different since I wanted to get the analyzer per field name:

rb.getSchema().getField("name").getFieldType().getAnalyzer()

thanks again!

paul

Le 15 mars 2011 à 02:44, Ahmet Arslan a écrit :

>> Within my custom query-component, I wish to obtain an
>> instance of the analyzer for a given named field.
>> Is a schema object I can access?
>
>
> public void process(ResponseBuilder rb) throws IOException {          
>
>   Map<String,FieldType> map =   rb.req.getSchema().getFieldTypes();
>
>   Analyzer analyzer =  map.get("myFieldName").getAnalyzer();
>   Analyzer queryAnalyzer = map.get("myFieldName").getQueryAnalyzer();
>
>
>