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 dhanesh <dh...@hifx.net> on 2011/01/06 09:06:06 UTC

forward slash not working in my solr search

Hi,
Can anybody help me to sort out an issue of forward slash in solr search .
I've a category combo box  and I'm searching based on the category.
Everything working fine except forward slash

My category is "Computer / IT"  and its not showing the result.
But when I removed the leading and trialing space from the slashes it 
worked (like 'Computer/IT')

The field that I specified for category is <field name="category" 
type="string" indexed="true" stored="true" />

Any clue???
dhanesh s.r



Re: forward slash not working in my solr search

Posted by Erick Erickson <er...@gmail.com>.
String type is unanalyzed. So what you put in the index better be exactly
what you query for, capitalization, spaces (internal and leading and
trailing etc).
So you are NOT searching the exact same thing, the spaces are different.
String
type is quite literal, and exact means exact.


You really have several choices here.
1> pre-process at both index and query time to remove spaces.
2> use something other than "string" type. See the admin/analysis page in
order to get an idea what
     is actually indexed and searched.

Best
Erick

On Thu, Jan 6, 2011 at 3:36 AM, dhanesh <dh...@hifx.net> wrote:

> On 1/6/2011 1:37 PM, Grijesh.singh wrote:
>
>> First you have to check that your indexing process can cause of removing
>> the
>> whitespace
>>
>> -----
>> Grijesh
>>
> While indexing to server I added the category as 'Computer / IT', but when
> I search with same keyword I am not getting any result.
> But when I changed the category 'Computer/IT' (note that I removed the
> space from the both sides of forward slash). and again I indexed to
> solar.This time I got the result.
> But my requirement is to index the category as 'Computer / IT' (with space
> in both  side of /)
> dhanesh
>
>
>

Re: forward slash not working in my solr search

Posted by dhanesh <dh...@hifx.net>.
On 1/6/2011 2:45 PM, Grijesh.singh wrote:
> use as pharase it will work like "Computer / IT" for you
>
> Here IT is a stopword when you are trying query as
>
> category:Computer / IT
>
> parsed as category:Computer<default-search-field>:IT
> but IT is a stopword for default search field what you have selected
>
> so second query removed and only category:Computer is showing
>
> use your query as
> category:"Computer / IT"
>
> -----
> Grijesh
Hi Grijesh.singh
It worked... :) You helped me to fix this issue.
Thanks a lot

cheers
dhanesh s.r


Re: forward slash not working in my solr search

Posted by "Grijesh.singh" <pi...@gmail.com>.
use as pharase it will work like "Computer / IT" for you

Here IT is a stopword when you are trying query as

category:Computer / IT

parsed as category:Computer <default-search-field>:IT
but IT is a stopword for default search field what you have selected

so second query removed and only category:Computer is showing

use your query as 
category:"Computer / IT"

-----
Grijesh
-- 
View this message in context: http://lucene.472066.n3.nabble.com/forward-slash-not-working-in-my-solr-search-tp2204326p2204575.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: forward slash not working in my solr search

Posted by dhanesh <dh...@hifx.net>.
On 1/6/2011 2:06 PM, Grijesh.singh wrote:
> check with debugQuery=on and also with analysis.jsp ,what happening with your
> query term and indexed terms.
>
> -----
> Grijesh
When I debug the query, I got the parsedquery as category:Computer


Here is debugged output

<lst name="debug">
<str name="rawquerystring">category:Computer / IT</str>
<str name="querystring">category:Computer / IT</str>
<str name="parsedquery">category:Computer</str>
<str name="parsedquery_toString">category:Computer</str>

Re: forward slash not working in my solr search

Posted by "Grijesh.singh" <pi...@gmail.com>.
check with debugQuery=on and also with analysis.jsp ,what happening with your
query term and indexed terms.

-----
Grijesh
-- 
View this message in context: http://lucene.472066.n3.nabble.com/forward-slash-not-working-in-my-solr-search-tp2204326p2204436.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: forward slash not working in my solr search

Posted by dhanesh <dh...@hifx.net>.
On 1/6/2011 1:37 PM, Grijesh.singh wrote:
> First you have to check that your indexing process can cause of removing the
> whitespace
>
> -----
> Grijesh
While indexing to server I added the category as 'Computer / IT', but 
when I search with same keyword I am not getting any result.
But when I changed the category 'Computer/IT' (note that I removed the 
space from the both sides of forward slash). and again I indexed to 
solar.This time I got the result.
But my requirement is to index the category as 'Computer / IT' (with 
space in both  side of /)
dhanesh



Re: forward slash not working in my solr search

Posted by "Grijesh.singh" <pi...@gmail.com>.
First you have to check that your indexing process can cause of removing the
whitespace

-----
Grijesh
-- 
View this message in context: http://lucene.472066.n3.nabble.com/forward-slash-not-working-in-my-solr-search-tp2204326p2204336.html
Sent from the Solr - User mailing list archive at Nabble.com.