> Hi Clark,
>  
> Thanks for your input. I have a query.
>  
>  
> I have my XML which contains the following:
>  
> <add>
> <doc>
>   <field name="url">http://www.sun.com</field>
>   <field name="title">information</field>
>   <field name="description">java plays a important
> role in computer industry for web users</field>
> </doc>
> <doc>
>   <field name="url">http://www.askguru.com</field>
>   <field name="title">homepage</field>
>   <field name="description">Information about
> technology is stored in the web sites</field>
> </doc>
> <doc>
>   <field name="url">http://www.techie.com</field>
>   <field name="title">post queries</field>
>   <field name="description">This web site have more
> java technology related to web</field>
> </doc>
> </add>
>  
> When I give “java technology” as my input in Solr admin
> page ,At present  I get output as 
>  
> <doc>
>   <field name="url">http://www.techie.com</field>
>   <field name="title">post queries</field>
>   <field name="description">This web site have more
> java technology related to web</field>
> </doc>
>  
> Now I need to get doc which has “technology” also
>  
> When I give “java technology “
>  
> I need to get output as,I need to give boosting to doc
> which has “technology”. It should display in the below
> order.The output should come as 
>  
> <doc>
>   <field name="url">http://www.techie.com</field>
>   <field name="title">post queries</field>
>   <field name="description">This web site have more
> java technology related to web</field>
> </doc>
> <doc>
>   <field name="url">http://www.askguru.com</field>
>   <field name="title">homepage</field>
>   <field name="description">Information about
> technology is stored in the web sites</field>
> </doc>
> <doc>
>   <field name="url">http://www.sun.com</field>
>   <field name="title">information</field>
>   <field name="description">java plays a important
> role in computer industry for web users</field>
> </doc>
>  
> Let me know how to achieve the same?

The query :  java^1 OR technology^100   will do it. Results will be in this 
order:

1-)This web site have more java technology related to web
2-)Information about technology is stored in the web sites
3-)java plays a important role in computer industry for web users

1-) contains both java and technology
2-) contains only technology
3-) contains only java

Is that what you want? 

Note that there is no "" quotes in the query above. And you can adjust boost 
factors (1 and 100) according to your needs. Use OR operator between terms. You 
set individual terms boost with ^ operator.

hope this helps.





Reply via email to