DIH - $deleteDocById

2010-06-25 Thread Ingar Hov
I seem to have a hard time to get $deleteDocById to work with the
XPathEntityProcessor. Anyone tested it and got it to work?

Here's a snippet of the code:
--
..


..


..

Whenever I try to run a delta-import with a document that should
delete from the index it only updates the document in the index. The
last line in the code above is based upon a tip I found on the net,
unsure if it's correct.  Any help would be appreciated.

Regards,
Ingar


Re: Build solr with Maven

2012-03-28 Thread Ingar Hov
Is there any good reason for keeping solr_home within the webapp?

It should work, but I would not recommend it. Have you configured
solr_home somewhere?
One way in Tomcat is to do something like this:

--

  

--

in either: $tomcat_home/conf/Catalina/localhost/solr.xml or in
$tomcat_home/conf/server xml.

A better solution would probably be a maven project, but with two
modules. This way you could build the modules together or
individually. Then you can make adjustments to the config and reload
core's at will, a feature you would lose with keeping solr_home within
the webapp.

Regards,
Ingar


On Wed, Mar 28, 2012 at 1:39 PM, Aleksander Akerø
 wrote:
> Hi
>
>
>
> My company has just decided to use maven to build new projects, which then
> includes building solr with maven too.
>
> But then it has been decided that solr_home also should be installed within
> the webapp someplace. But now I have got the problem that solr can’t find
> the config files and so on. I have come across some posts here and there
> which says that solr_home should not be placed within the webapp.
>
> Is that correct? If so, what are the reasons for it, and should it not work
> at all?
>
>
>
> Aleksander Akerø
>


Re: Build solr with Maven

2012-03-29 Thread Ingar Hov
I see..

Try to use ... in web.xml.

Regards,
Ingar

On Thu, Mar 29, 2012 at 8:34 AM, Aleksander Akerø
 wrote:
> Well, it's got all to do with how we have decided the rest of our deployment
> environment. So the point is basicly that there should be no configurations
> to the tomcat because the webapp should know all it's settings and could
> basicly be deployed to whatever tomcat without configuration. Also there
> should be no configuration done outside the webapp.
>
> That is basicly the rule that I have to live by, and I'm very thankful for
> your solution here but a tomcat configuration is out of the question.
> I was hoping there was some way to set this via mavens pom.xml or something
> like that.
>
> -Original Message-
> From: Ingar Hov [mailto:ingar@gmail.com]
> Sent: 28. mars 2012 18:48
> To: solr-user@lucene.apache.org
> Subject: Re: Build solr with Maven
>
> Is there any good reason for keeping solr_home within the webapp?
>
> It should work, but I would not recommend it. Have you configured solr_home
> somewhere?
> One way in Tomcat is to do something like this:
>
> --
> 
>   value="[your_solr_home]" override="true"/> 
> --
>
> in either: $tomcat_home/conf/Catalina/localhost/solr.xml or in
> $tomcat_home/conf/server xml.
>
> A better solution would probably be a maven project, but with two modules.
> This way you could build the modules together or individually. Then you can
> make adjustments to the config and reload core's at will, a feature you
> would lose with keeping solr_home within the webapp.
>
> Regards,
> Ingar
>
>
> On Wed, Mar 28, 2012 at 1:39 PM, Aleksander Akerø 
> wrote:
>> Hi
>>
>>
>>
>> My company has just decided to use maven to build new projects, which
>> then includes building solr with maven too.
>>
>> But then it has been decided that solr_home also should be installed
>> within the webapp someplace. But now I have got the problem that solr
>> can’t find the config files and so on. I have come across some posts
>> here and there which says that solr_home should not be placed within the
> webapp.
>>
>> Is that correct? If so, what are the reasons for it, and should it not
>> work at all?
>>
>>
>>
>> Aleksander Akerø
>>
>


Re: Build solr with Maven

2012-03-29 Thread Ingar Hov
I think you need absolute path. But perhaps if $CATALINA_HOME or
$TOMCAT_HOME is set, you can use it with your path.Haven't tried it
though..

In any case, you should quite easily be able to verify if relative
paths can be used. All you need to do is to get the work directory for
the webapp and reflect that with your variable. In any case I don't
think you can use a path relative to web.xml. I believe the work
directory is somewhere else than /WEB-INF/ and that is the dir you
need to make your variable relative to..


On Thu, Mar 29, 2012 at 1:28 PM, Aleksander Akerø
 wrote:
> Tried that, but I guess I am doing it wrong somehow with the paths.
>
> The home folder should be WEB-INF/solr inside the tomcat. But how would I
> set that path correctly? Do I need to use absolute paths?
>
> -Original Message-
> From: Ingar Hov [mailto:ingar@gmail.com]
> Sent: 29. mars 2012 12:57
> To: solr-user@lucene.apache.org
> Subject: Re: Build solr with Maven
>
> I see..
>
> Try to use ... in web.xml.
>
> Regards,
> Ingar
>
> On Thu, Mar 29, 2012 at 8:34 AM, Aleksander Akerø 
> wrote:
>> Well, it's got all to do with how we have decided the rest of our
>> deployment environment. So the point is basicly that there should be
>> no configurations to the tomcat because the webapp should know all
>> it's settings and could basicly be deployed to whatever tomcat without
>> configuration. Also there should be no configuration done outside the
> webapp.
>>
>> That is basicly the rule that I have to live by, and I'm very thankful
>> for your solution here but a tomcat configuration is out of the question.
>> I was hoping there was some way to set this via mavens pom.xml or
>> something like that.
>>
>> -Original Message-
>> From: Ingar Hov [mailto:ingar@gmail.com]
>> Sent: 28. mars 2012 18:48
>> To: solr-user@lucene.apache.org
>> Subject: Re: Build solr with Maven
>>
>> Is there any good reason for keeping solr_home within the webapp?
>>
>> It should work, but I would not recommend it. Have you configured
>> solr_home somewhere?
>> One way in Tomcat is to do something like this:
>>
>> --
>> 
>>  > value="[your_solr_home]" override="true"/> 
>> --
>>
>> in either: $tomcat_home/conf/Catalina/localhost/solr.xml or in
>> $tomcat_home/conf/server xml.
>>
>> A better solution would probably be a maven project, but with two modules.
>> This way you could build the modules together or individually. Then
>> you can make adjustments to the config and reload core's at will, a
>> feature you would lose with keeping solr_home within the webapp.
>>
>> Regards,
>> Ingar
>>
>>
>> On Wed, Mar 28, 2012 at 1:39 PM, Aleksander Akerø
>> 
>> wrote:
>>> Hi
>>>
>>>
>>>
>>> My company has just decided to use maven to build new projects, which
>>> then includes building solr with maven too.
>>>
>>> But then it has been decided that solr_home also should be installed
>>> within the webapp someplace. But now I have got the problem that solr
>>> can’t find the config files and so on. I have come across some posts
>>> here and there which says that solr_home should not be placed within
>>> the
>> webapp.
>>>
>>> Is that correct? If so, what are the reasons for it, and should it
>>> not work at all?
>>>
>>>
>>>
>>> Aleksander Akerø
>>>
>>
>


Re: Group.query

2012-09-26 Thread Ingar Hov
I hope I understood the question, if so this may be a solution:

Why don't you make the field group for product multiple?

Example:



If the product is a member of group1 and group2, just add both for the
product document so that each product has an array of group. Then you
can easily get all products for group1 by doing query: group:group1

Regards,
Ingar



On Wed, Sep 26, 2012 at 10:48 AM, Peter Kirk  wrote:
> Thanks. Yes, the only solution I could think of was to execute several 
> queries.
> I would like it to be a single query if at all possible. If anyone has ideas 
> I could look into that would be great.
> Thanks,
> Peter
>
>
> -Original Message-
> From: Aditya [mailto:findbestopensou...@gmail.com]
> Sent: 26. september 2012 10:41
> To: solr-user@lucene.apache.org
> Subject: Re: Group.query
>
> Hi
>
> You are doing AND search, so you are getting results prod1 and prod2. I 
> guess, you should query only for group1 and another query for group2.
>
> Regards
> Aditya
> www.findbestopensource.com
>
>
>
> On Wed, Sep 26, 2012 at 12:26 PM, Peter Kirk  wrote:
>
>> Hi
>>
>> I have "products" which belong to one or more "groups".
>> Products are documents in Solr, while the groups are fields (eg.
>> group_1_bool:true).
>>
>> For example:
>>
>> Prod1 => group1, group2
>> Prod2 => group1, group2
>> Prod3 => group1
>> Prod4 => group2
>>
>> I would like to execute a query which results in the groups with their
>> products. That is, the result should be something like:
>>
>> Group1 => Prod1, Prod2, Prod3
>> Group2 => Prod1, Prod2, Prod4
>>
>> How can I do this?
>>
>> I've been looking at group.query, but I don't think this is what I want.
>>
>> For example, "q=*:*&group.query=group_1_bool:true+AND+group_2_bool:true"
>> Results in 1 group called "group_1_bool:true AND group_2_bool:true",
>> which contains prod1 and prod2.
>>
>>
>> Thanks,
>> Peter
>>
>>
>


Re: RE: Group.query

2012-09-26 Thread Ingar Hov
Looks like you are considering hierarchical facet of some sort.
Haven't looked at it in a while, but if you decide to go that way you
may open up a can of worms..

I would reconsider the datastructure first to see if that is really needed.

You could perhaps solve this with:





Then you get 2 facets, bucket and group when you search. Buckets will
not be grouped though..

Regards,
Ingar


On Wed, Sep 26, 2012 at 12:23 PM,   wrote:
> I think what you need is facetting, or is this another thing?
> http://searchhub.org/dev/2009/09/02/faceted-search-with-solr/
>
> Peter Kirk  schrieb am 26.09.2012 12:18:32:
>
>> Von:
>>
>> Peter Kirk 
>>
>> An:
>>
>> "solr-user@lucene.apache.org" 
>>
>> Datum:
>>
>> 26.09.2012 12:19
>>
>> Betreff:
>>
>> RE: Group.query
>>
>> Thanks. Yes I can do this - but doesn't it mean I need to execute a
>> query per group?
>>
>> What I really want to do (and I'm sorry I'm not so good at
>> explaining) is to execute one query for products, and receive
>> results grouped by the groups - but where a particular product may
>> be found in several groups.
>>
>> For example, I'd like to execute a query for all products which
>> match "bucket".
>> There are several products which are "buckets", each of which can
>> belong to several groups.
>> Would it be possible to generate a query which would return the
>> groups, each with a list of the buckets?
>>
>> Example result, with 3 groups, and several products (which may occur
>> in several groups).
>>
>> Children_sand_toys
>>   Castle bucket
>>   Plain bucket
>>
>> Boys_toys
>>   Castle bucket
>>   Truck bucket
>>
>> Girls_toys
>>   Castle bucket
>>   Large Pony bucket
>>
>> Thanks,
>> Peter
>>
>> -Original Message-
>> From: Ingar Hov [mailto:ingar@gmail.com]
>> Sent: 26. september 2012 11:57
>> To: solr-user@lucene.apache.org
>> Subject: Re: Group.query
>>
>> I hope I understood the question, if so this may be a solution:
>>
>> Why don't you make the field group for product multiple?
>>
>> Example:
>>
>> > multiValued="true"/>
>>
>> If the product is a member of group1 and group2, just add both for
>> the product document so that each product has an array of group.
>> Then you can easily get all products for group1 by doing query:
> group:group1
>>
>> Regards,
>> Ingar
>>
>>
>>
>> On Wed, Sep 26, 2012 at 10:48 AM, Peter Kirk 
> wrote:
>> > Thanks. Yes, the only solution I could think of was to execute
>> several queries.
>> > I would like it to be a single query if at all possible. If anyone
>> has ideas I could look into that would be great.
>> > Thanks,
>> > Peter
>> >
>> >
>> > -Original Message-
>> > From: Aditya [mailto:findbestopensou...@gmail.com]
>> > Sent: 26. september 2012 10:41
>> > To: solr-user@lucene.apache.org
>> > Subject: Re: Group.query
>> >
>> > Hi
>> >
>> > You are doing AND search, so you are getting results prod1 and
>> prod2. I guess, you should query only for group1 and another query for
> group2.
>> >
>> > Regards
>> > Aditya
>> > www.findbestopensource.com
>> >
>> >
>> >
>> > On Wed, Sep 26, 2012 at 12:26 PM, Peter Kirk 
> wrote:
>> >
>> >> Hi
>> >>
>> >> I have "products" which belong to one or more "groups".
>> >> Products are documents in Solr, while the groups are fields (eg.
>> >> group_1_bool:true).
>> >>
>> >> For example:
>> >>
>> >> Prod1 => group1, group2
>> >> Prod2 => group1, group2
>> >> Prod3 => group1
>> >> Prod4 => group2
>> >>
>> >> I would like to execute a query which results in the groups with
>> >> their products. That is, the result should be something like:
>> >>
>> >> Group1 => Prod1, Prod2, Prod3
>> >> Group2 => Prod1, Prod2, Prod4
>> >>
>> >> How can I do this?
>> >>
>> >> I've been looking at group.query, but I don't think this is what I
> want.
>> >>
>> >> For example,
> "q=*:*&group.query=group_1_bool:true+AND+group_2_bool:true"
>> >> Results in 1 group called "group_1_bool:true AND group_2_bool:true",
>> >> which contains prod1 and prod2.
>> >>
>> >>
>> >> Thanks,
>> >> Peter
>> >>
>> >>
>> >
>>
>>


Re: RE: Group.query

2012-09-26 Thread Ingar Hov
Disregard my previous post I think I misunderstood. Johannes is right.

Facet is the solution.



Where group = Children_sand_toys, Boys_toys, Girls_toys

q=bucket&facet=true&facet.field=group&wt=xml

Regards,
Ingar

On Wed, Sep 26, 2012 at 1:00 PM, Ingar Hov  wrote:
> Looks like you are considering hierarchical facet of some sort.
> Haven't looked at it in a while, but if you decide to go that way you
> may open up a can of worms..
>
> I would reconsider the datastructure first to see if that is really needed.
>
> You could perhaps solve this with:
>
>  multiValued="true"/>
>
>  multiValued="true"/>
>
> Then you get 2 facets, bucket and group when you search. Buckets will
> not be grouped though..
>
> Regards,
> Ingar
>
>
> On Wed, Sep 26, 2012 at 12:23 PM,   wrote:
>> I think what you need is facetting, or is this another thing?
>> http://searchhub.org/dev/2009/09/02/faceted-search-with-solr/
>>
>> Peter Kirk  schrieb am 26.09.2012 12:18:32:
>>
>>> Von:
>>>
>>> Peter Kirk 
>>>
>>> An:
>>>
>>> "solr-user@lucene.apache.org" 
>>>
>>> Datum:
>>>
>>> 26.09.2012 12:19
>>>
>>> Betreff:
>>>
>>> RE: Group.query
>>>
>>> Thanks. Yes I can do this - but doesn't it mean I need to execute a
>>> query per group?
>>>
>>> What I really want to do (and I'm sorry I'm not so good at
>>> explaining) is to execute one query for products, and receive
>>> results grouped by the groups - but where a particular product may
>>> be found in several groups.
>>>
>>> For example, I'd like to execute a query for all products which
>>> match "bucket".
>>> There are several products which are "buckets", each of which can
>>> belong to several groups.
>>> Would it be possible to generate a query which would return the
>>> groups, each with a list of the buckets?
>>>
>>> Example result, with 3 groups, and several products (which may occur
>>> in several groups).
>>>
>>> Children_sand_toys
>>>   Castle bucket
>>>   Plain bucket
>>>
>>> Boys_toys
>>>   Castle bucket
>>>   Truck bucket
>>>
>>> Girls_toys
>>>   Castle bucket
>>>   Large Pony bucket
>>>
>>> Thanks,
>>> Peter
>>>
>>> -Original Message-
>>> From: Ingar Hov [mailto:ingar@gmail.com]
>>> Sent: 26. september 2012 11:57
>>> To: solr-user@lucene.apache.org
>>> Subject: Re: Group.query
>>>
>>> I hope I understood the question, if so this may be a solution:
>>>
>>> Why don't you make the field group for product multiple?
>>>
>>> Example:
>>>
>>> >> multiValued="true"/>
>>>
>>> If the product is a member of group1 and group2, just add both for
>>> the product document so that each product has an array of group.
>>> Then you can easily get all products for group1 by doing query:
>> group:group1
>>>
>>> Regards,
>>> Ingar
>>>
>>>
>>>
>>> On Wed, Sep 26, 2012 at 10:48 AM, Peter Kirk 
>> wrote:
>>> > Thanks. Yes, the only solution I could think of was to execute
>>> several queries.
>>> > I would like it to be a single query if at all possible. If anyone
>>> has ideas I could look into that would be great.
>>> > Thanks,
>>> > Peter
>>> >
>>> >
>>> > -Original Message-
>>> > From: Aditya [mailto:findbestopensou...@gmail.com]
>>> > Sent: 26. september 2012 10:41
>>> > To: solr-user@lucene.apache.org
>>> > Subject: Re: Group.query
>>> >
>>> > Hi
>>> >
>>> > You are doing AND search, so you are getting results prod1 and
>>> prod2. I guess, you should query only for group1 and another query for
>> group2.
>>> >
>>> > Regards
>>> > Aditya
>>> > www.findbestopensource.com
>>> >
>>> >
>>> >
>>> > On Wed, Sep 26, 2012 at 12:26 PM, Peter Kirk 
>> wrote:
>>> >
>>> >> Hi
>>> >>
>>> >> I have "products" which belong to one or more "groups".
>>> >> Products are documents in Solr, while the groups are fields (eg.
>>> >> group_1_bool:true).
>>> >>
>>> >> For example:
>>> >>
>>> >> Prod1 => group1, group2
>>> >> Prod2 => group1, group2
>>> >> Prod3 => group1
>>> >> Prod4 => group2
>>> >>
>>> >> I would like to execute a query which results in the groups with
>>> >> their products. That is, the result should be something like:
>>> >>
>>> >> Group1 => Prod1, Prod2, Prod3
>>> >> Group2 => Prod1, Prod2, Prod4
>>> >>
>>> >> How can I do this?
>>> >>
>>> >> I've been looking at group.query, but I don't think this is what I
>> want.
>>> >>
>>> >> For example,
>> "q=*:*&group.query=group_1_bool:true+AND+group_2_bool:true"
>>> >> Results in 1 group called "group_1_bool:true AND group_2_bool:true",
>>> >> which contains prod1 and prod2.
>>> >>
>>> >>
>>> >> Thanks,
>>> >> Peter
>>> >>
>>> >>
>>> >
>>>
>>>