You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Eugeny Balakhonov <c0...@gmail.com> on 2011/08/10 23:27:03 UTC

Solr schema: Sentence to refine copyField command

Hello, all!

 

According to documentation Solr one field for search by default is possible
only:

 

<defaultSearchField>TEXT</defaultSearchField>

 

This field can be filled with following commands:

 

<copyField source="FIELD1" dest="TEXT"/>

<copyField source="FIELD2" dest="TEXT"/>

<copyField source="FIELD3" dest="TEXT"/>

 

In this case the "TEXT" field is purely technical and isn't intended for an
output to the user.

 

By search with q=foo we will receive result as is resulted in a following
example::

 

.....

<lst name="highlighting">

    <lst name="154203.6194667...">

        <arr name="TEXT">

            <str>Something <em>foo</em></str>

        </arr>

    </lst>

    <lst name="154203.6711988...">

        <arr name="TEXT">

            <str> Something <em>foo</em></str>

        </arr>

    </lst>

</lst>

......

 

But in this case we have no information where really the found string
"Something foo" is stored in the source document. 

I suggest to expand of copyField command for storing a name of source field:

 

In the Solr schema:

 

<copyField source="ENT_LIST_ENT_GCP" dest="TEXT" saveSourceFieldName="true"
/>

 

In the search result:

 

.....

<arr name="TEXT">

    <str source="FIELD1">Something foo</str>

    <str source="FIELD2">foo foo</str>

    <str source="FIELD3">123 123 123</str>

</arr>

.....

<lst name="highlighting">

    <lst name="154203.6194667...">

        <arr name="TEXT">

            <str source="FIELD1">Something <em>foo</em></str>

        </arr>

    </lst>

    <lst name="154203.6711988...">

        <arr name="TEXT">

            <str source="FIELD1"> Something <em>foo</em></str>

        </arr>

    </lst>

</lst>

......

 

I think that this is very useful feature. There can be someone from
developers will become interested in its implementation? 

 

Best regards,

Eugeny


Re: Solr schema: Sentence to refine copyField command

Posted by Erik Hatcher <er...@gmail.com>.
Eugeny -

Rather than add another feature like this, consider using the hl.fl parameter (see http://wiki.apache.org/solr/HighlightingParameters for details) for specifying the other fields you want highlighted.  And also consider not storing the TEXT field as you don't really need it given you will be storing FIELD1...FIELD3.

	Erik

On Aug 10, 2011, at 17:27 , Eugeny Balakhonov wrote:

> Hello, all!
>  
> According to documentation Solr one field for search by default is possible only:
>  
> <defaultSearchField>TEXT</defaultSearchField>
>  
> This field can be filled with following commands:
>  
> <copyField source="FIELD1" dest="TEXT"/>
> <copyField source="FIELD2" dest="TEXT"/>
> <copyField source="FIELD3" dest="TEXT"/>
>  
> In this case the “TEXT” field is purely technical and isn't intended for an output to the user.
>  
> By search with q=foo we will receive result as is resulted in a following example::
>  
> ………….
> <lst name="highlighting">
>     <lst name="154203.6194667...">
>         <arr name="TEXT">
>             <str>Something <em>foo</em></str>
>         </arr>
>     </lst>
>     <lst name="154203.6711988...">
>         <arr name="TEXT">
>             <str> Something <em>foo</em></str>
>         </arr>
>     </lst>
> </lst>
> …………..
>  
> But in this case we have no information where really the found string "Something foo" is stored in the source document.
> I suggest to expand of copyField command for storing a name of source field:
>  
> In the Solr schema:
>  
> <copyField source="ENT_LIST_ENT_GCP" dest="TEXT" saveSourceFieldName=”true” />
>  
> In the search result:
>  
> ………….
> <arr name="TEXT">
>     <str source="FIELD1">Something foo</str>
>     <str source="FIELD2">foo foo</str>
>     <str source="FIELD3">123 123 123</str>
> </arr>
> ………….
> <lst name="highlighting">
>     <lst name="154203.6194667...">
>         <arr name="TEXT">
>             <str source="FIELD1">Something <em>foo</em></str>
>         </arr>
>     </lst>
>     <lst name="154203.6711988...">
>         <arr name="TEXT">
>             <str source="FIELD1"> Something <em>foo</em></str>
>         </arr>
>     </lst>
> </lst>
> …………..
>  
> I think that this is very useful feature. There can be someone from developers will become interested in its implementation?
>  
> Best regards,
> Eugeny


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org