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 bhecht <bh...@ams-sys.com> on 2007/05/15 21:55:18 UTC
Using Solr without using a web-app
Hello all,
I am using Lucene and hibernate search. I downloaded the Solr sources and
found there some classes I want to use:
1) SynonymFilter
2) WordDelimiterFilter
I have no use in Solr except for this at the moment.
How can I use these classes without the need of using the configuration
files of Solr, or is it possible to use these classes and using the Solr
config files, without loading the whole Solr framework just for this?
Thanks in advance
--
View this message in context: http://www.nabble.com/Using-Solr-without-using-a-web-app-tf3760714.html#a10629880
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Using Solr without using a web-app
Posted by "J.J. Larrea" <jj...@panix.com>.
At 4:29 PM -0400 5/15/07, Yonik Seeley wrote:
>On 5/15/07, bhecht <bh...@ams-sys.com> wrote:
>>[...] the function parseRules in SynonymFilterFactory is private
>
>If you start using Solr's configuration, you drag more of Solr in.
>
>You can add the synonyms to the SynonymMap yourself, or if you want to
>use a solr-style synonyms.txt, perhaps just extract the code that
>implements that.
I don't want to be a troublemaker, but it could be argued that while the parsing of the param Map and calling of Config.getLines done by SynonymFilterFactory is both factory-specific and Solr-config-specific, that the actual parseRules should be a public static method within SynonymFilter itself -- changed to take an Iterator<String> rather than List<String> so it could be used with other sources -- since that would greatly simplify its adoption in other environments. It's a rather useful tool.
(And yes I'd submit a patch...)
- J.J.
Re: Using Solr without using a web-app
Posted by bhecht <bh...@ams-sys.com>.
Great, thanks for the patience and help.
Good day.
Yonik Seeley wrote:
>
> On 5/15/07, bhecht <bh...@ams-sys.com> wrote:
>> OK, that was what I was trying to avoid, but for this cool functionality
>> I
>> will do so.
>> Just cut and paste the factory classes and change the init functions, not
>> to
>> use the args[] parameter.
>>
>> What kind of copyright (if any) do I need to include in these 2 classes
>> which I will cut and paste ?
>> I just never incorporated in my source, sources from open source
>> frameworks
>> in such an obvious way.
>> Thanks
>
> Just keep the top with the Apache blurb.
> The LICENSE.txt actually spells it out. If you are already using
> Lucene, I don't think you should have to do anything extra to
> incorporate Solr components that come from the ASF.
>
> -Yonik
>
>
--
View this message in context: http://www.nabble.com/Using-Solr-without-using-a-web-app-tf3760714.html#a10630985
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Using Solr without using a web-app
Posted by Yonik Seeley <yo...@apache.org>.
On 5/15/07, bhecht <bh...@ams-sys.com> wrote:
> OK, that was what I was trying to avoid, but for this cool functionality I
> will do so.
> Just cut and paste the factory classes and change the init functions, not to
> use the args[] parameter.
>
> What kind of copyright (if any) do I need to include in these 2 classes
> which I will cut and paste ?
> I just never incorporated in my source, sources from open source frameworks
> in such an obvious way.
> Thanks
Just keep the top with the Apache blurb.
The LICENSE.txt actually spells it out. If you are already using
Lucene, I don't think you should have to do anything extra to
incorporate Solr components that come from the ASF.
-Yonik
Re: Using Solr without using a web-app
Posted by bhecht <bh...@ams-sys.com>.
OK, that was what I was trying to avoid, but for this cool functionality I
will do so.
Just cut and paste the factory classes and change the init functions, not to
use the args[] parameter.
What kind of copyright (if any) do I need to include in these 2 classes
which I will cut and paste ?
I just never incorporated in my source, sources from open source frameworks
in such an obvious way.
Thanks
Yonik Seeley wrote:
>
> On 5/15/07, bhecht <bh...@ams-sys.com> wrote:
>> When trying to do so, i discover that the function parseRules in
>> SynonymFilterFactory is private, and I need to call this function when I
>> want to populate the SynonymMap like here:
>> parseRules(wlist, synMap, "=>", ",", ignoreCase,expand);
>>
>> any suggestions?
>
> If you start using Solr's configuration, you drag more of Solr in.
>
> You can add the synonyms to the SynonymMap yourself, or if you want to
> use a solr-style synonyms.txt, perhaps just extract the code that
> implements that.
>
> -Yonik
>
>
--
View this message in context: http://www.nabble.com/Using-Solr-without-using-a-web-app-tf3760714.html#a10630646
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Using Solr without using a web-app
Posted by Yonik Seeley <yo...@apache.org>.
On 5/15/07, bhecht <bh...@ams-sys.com> wrote:
> When trying to do so, i discover that the function parseRules in
> SynonymFilterFactory is private, and I need to call this function when I
> want to populate the SynonymMap like here:
> parseRules(wlist, synMap, "=>", ",", ignoreCase,expand);
>
> any suggestions?
If you start using Solr's configuration, you drag more of Solr in.
You can add the synonyms to the SynonymMap yourself, or if you want to
use a solr-style synonyms.txt, perhaps just extract the code that
implements that.
-Yonik
Re: Using Solr without using a web-app
Posted by bhecht <bh...@ams-sys.com>.
Hi yonik again,
When trying to do so, i discover that the function parseRules in
SynonymFilterFactory is private, and I need to call this function when I
want to populate the SynonymMap like here:
parseRules(wlist, synMap, "=>", ",", ignoreCase,expand);
any suggestions?
bhecht wrote:
>
> Thanks yonik.
> For some reason I thought it was much more complicated, but looking at the
> sources again I see its going to be an easy task.
> Thanks for the help.
>
--
View this message in context: http://www.nabble.com/Using-Solr-without-using-a-web-app-tf3760714.html#a10630317
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Using Solr without using a web-app
Posted by bhecht <bh...@ams-sys.com>.
Thanks yonik.
For some reason I thought it was much more complicated, but looking at the
sources again I see its going to be an easy task.
Thanks for the help.
--
View this message in context: http://www.nabble.com/Using-Solr-without-using-a-web-app-tf3760714.html#a10630065
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Using Solr without using a web-app
Posted by Yonik Seeley <yo...@apache.org>.
On 5/15/07, bhecht <bh...@ams-sys.com> wrote:
> I am using Lucene and hibernate search. I downloaded the Solr sources and
> found there some classes I want to use:
>
> 1) SynonymFilter
> 2) WordDelimiterFilter
>
> I have no use in Solr except for this at the moment.
> How can I use these classes without the need of using the configuration
> files of Solr, or is it possible to use these classes and using the Solr
> config files, without loading the whole Solr framework just for this?
Use the filters without the filter factories... the filters themselves
have no Solr dependencies.
Look at the factories for how to create and configure the filters.
-Yonik