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 Rohit <ro...@in-rev.com> on 2012/02/15 20:04:25 UTC
Search for hashtags and mentions
Hi,
We are using solr version 3.5 to search though Tweets, I am using
WordDelimiterFactory with the following setting, to be able to search for
@username or #hashtags
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1"
generateNumberParts="1" catenateWords="1" catenateNumbers="1"
catenateAll="0" splitOnCaseChange="0" splitOnNumerics="0"
preserveOriginal="1" handleAsChar="@#"/>
I saw the following patch but this doesn't seem to be working as I expected,
am I missing something?
https://issues.apache.org/jira/browse/SOLR-2059
But searching for @username is also returning results for just username or
#hashtag is just returning result for hastag. How can I achieve this?
Regards,
Rohit
Re: Search for hashtags and mentions
Posted by Erick Erickson <er...@gmail.com>.
We need the rest of your fieldType, it's quite possible
that other parts of it are stripping out the characters
in question. Try looking at the admin/analysis page.
If that doesn't help, please show us the whole fieldType
definition and the results of attaching &debugQuery=on
to the URL.
Best
Erick
On Wed, Feb 15, 2012 at 2:04 PM, Rohit <ro...@in-rev.com> wrote:
> Hi,
>
>
>
> We are using solr version 3.5 to search though Tweets, I am using
> WordDelimiterFactory with the following setting, to be able to search for
> @username or #hashtags
>
>
>
> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1"
> generateNumberParts="1" catenateWords="1" catenateNumbers="1"
> catenateAll="0" splitOnCaseChange="0" splitOnNumerics="0"
> preserveOriginal="1" handleAsChar="@#"/>
>
>
>
> I saw the following patch but this doesn't seem to be working as I expected,
> am I missing something?
>
>
>
> https://issues.apache.org/jira/browse/SOLR-2059
>
>
>
> But searching for @username is also returning results for just username or
> #hashtag is just returning result for hastag. How can I achieve this?
>
>
>
> Regards,
>
> Rohit
>
RE: Search for hashtags and mentions
Posted by Rohit <ro...@in-rev.com>.
Go the problem, I need to user "types=" parameter to ignore character like #,@ in WordDelimiterFilterFactory factory.
Regards,
Rohit
Mobile: +91-9901768202
About Me: http://about.me/rohitg
-----Original Message-----
From: Robert Muir [mailto:rcmuir@gmail.com]
Sent: 16 February 2012 06:22
To: solr-user@lucene.apache.org
Subject: Re: Search for hashtags and mentions
On Wed, Feb 15, 2012 at 2:04 PM, Rohit <ro...@in-rev.com> wrote:
> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1"
> generateNumberParts="1" catenateWords="1" catenateNumbers="1"
> catenateAll="0" splitOnCaseChange="0" splitOnNumerics="0"
> preserveOriginal="1" handleAsChar="@#"/>
There is no such parameter as 'handleAsChar'. If you want to do this,
you need to use a custom types file.
http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.WordDelimiterFilterFactory
--
lucidimagination.com
Re: Search for hashtags and mentions
Posted by Robert Muir <rc...@gmail.com>.
On Wed, Feb 15, 2012 at 2:04 PM, Rohit <ro...@in-rev.com> wrote:
> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1"
> generateNumberParts="1" catenateWords="1" catenateNumbers="1"
> catenateAll="0" splitOnCaseChange="0" splitOnNumerics="0"
> preserveOriginal="1" handleAsChar="@#"/>
There is no such parameter as 'handleAsChar'. If you want to do this,
you need to use a custom types file.
http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.WordDelimiterFilterFactory
--
lucidimagination.com
Re: Search for hashtags and mentions
Posted by Emmanuel Espina <es...@gmail.com>.
Do you want to index the hashtags and usernames to different fields?
Probably using
http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.PatternTokenizerFactory
will solve your problem.
However I don't fully understand the problem when you search
Thanks
Emmanuel
2012/2/15 Rohit <ro...@in-rev.com>:
> Hi,
>
>
>
> We are using solr version 3.5 to search though Tweets, I am using
> WordDelimiterFactory with the following setting, to be able to search for
> @username or #hashtags
>
>
>
> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1"
> generateNumberParts="1" catenateWords="1" catenateNumbers="1"
> catenateAll="0" splitOnCaseChange="0" splitOnNumerics="0"
> preserveOriginal="1" handleAsChar="@#"/>
>
>
>
> I saw the following patch but this doesn't seem to be working as I expected,
> am I missing something?
>
>
>
> https://issues.apache.org/jira/browse/SOLR-2059
>
>
>
> But searching for @username is also returning results for just username or
> #hashtag is just returning result for hastag. How can I achieve this?
>
>
>
> Regards,
>
> Rohit
>