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 Thomas Joiner <th...@gmail.com> on 2010/08/06 17:02:02 UTC

how to create a custom type in Solr

I need to have a field that supports ranges...for instance, you specify a
range of 8000 to 9000 and if you search for 8500, it will hit.  However,
when googling, I really couldn't find any resources on how to create your
own field type in Solr.

But from what I was able to find, the AbstractSubTypeFieldType class seems
like a good starting point for the type that I want to make, however that
isn't in the current version of Solr that I am using (1.4.1).  So I guess my
question is: is Solr 3.0 ready for production?  If so, how do I get it? Do I
just need to checkout the code from svn and build it myself?  If so should I
just check out the latest, or is there a particular branch that I should go
with that is reliable?  If I switch to 3.0, will I need to reindex my data,
or has the data format not changed?

And if 3.0 isn't ready for production, what would you suggest I do?  Is the
AbstractSubTypeFieldType such that I can backport it and use it with 1.4.1,
or does it use specific features of 3.0 that I would have to backport as
well, in which case it would become a horribly convoluted mess where I would
be better off just going with 3.0.  And I guess this comes back to help on
finding resources about implementing custom types...it would just be more
complicated if I couldn't use the AbstractSubTypeFieldType.

(This is my first time posting to a mailing list, so if I have violated
horribly some etiquette of mailing lists, please tell me).

Regards,
Thomas

Re: how to create a custom type in Solr

Posted by Thomas Joiner <th...@gmail.com>.
Thanks you very much.

I know the feeling, I've definitely had times when I just got busy and
didn't reply, but I've had plenty to do that didn't require that to be done
first, so no worries.

Thanks,
Thomas

On Mon, Aug 16, 2010 at 9:14 AM, Mark Allan <ma...@ed.ac.uk> wrote:

> Hi Thomas,
>
> Sorry for not replying before now - I've had your email flagged in my mail
> client to remind me to reply, but I've been so busy recently I never got
> round to it.
>
> I'll package up the necessary java files and send you the attachment
> directly instead of posting a zip file to the mailing list, which in most
> places would be against list etiquette.
>
> Mark
>
>
> On 16 Aug 2010, at 3:01 pm, Thomas Joiner wrote:
>
>  Sorry to bother you, but since I haven't had a reply in a week, I figured
>> I'd try asking again...
>>
>> What build of Solr are you using personally?  Are you just using a nightly
>> build, or is there a specific build that you are using?  Has it had any
>> major screw-ups for you?
>>
>> And I still would love to see your code.
>>
>> Regards,
>> Thomas
>>
>> On Mon, Aug 9, 2010 at 8:50 AM, Thomas Joiner <thomas.b.joiner@gmail.com
>> >wrote:
>>
>>  I'd love to see your code on this, however what I've really been
>>> wondering
>>> is the following: When did AbstractSubTypeFieldType get added?  It isn't
>>> in
>>> 1.4.1 (as far as I can tell that's the latest one that is bundled on
>>> their
>>> site).  So, do I just need to grab it from subversion, and build it?  And
>>> if
>>> so, is there a particular revision that I should go with?  Or should I
>>> just
>>> pull trunk and use that, and last of all, is trunk stable enough to be
>>> used
>>> in production?
>>>
>>> Regards,
>>> Thomas
>>>
>>>
>>> On Mon, Aug 9, 2010 at 8:38 AM, Mark Allan <ma...@ed.ac.uk> wrote:
>>>
>>>  On 9 Aug 2010, at 1:01 pm, Otis Gospodnetic wrote:
>>>>
>>>> Mark,
>>>>
>>>>>
>>>>> A good way to get your changes/improvements into Solr is by putting
>>>>> them
>>>>> in
>>>>> JIRA.  Please see http://wiki.apache.org/solr/HowToContribute
>>>>>
>>>>> Thanks!
>>>>> Otis
>>>>>
>>>>>
>>>>
>>>> Hi Otis,
>>>>
>>>> For the class which requires only minor modifications, I tested it to
>>>> ensure it doesn't break existing compatibility/functionality, and then I
>>>> created an issue in JIRA and uploaded a patch:
>>>>      https://issues.apache.org/jira/browse/SOLR-1986
>>>>
>>>> I then posted a message about it to the list and got the following
>>>> responses.
>>>>
>>>> On 7 Jul 2010, at 6:24 pm, Yonik Seeley wrote:
>>>>
>>>>  On Wed, Jul 7, 2010 at 8:15 AM, Grant Ingersoll <gs...@apache.org>
>>>>> wrote:
>>>>>
>>>>>  Originally, I had intended that it was just for one Field Sub Type,
>>>>>> thinking that if we ever wanted multiple sub types, that a new,
>>>>>> separate
>>>>>> class would be needed
>>>>>>
>>>>>>
>>>>> Right - this was my original thinking too.  AbstractSubTypeFieldType is
>>>>> only a convenience class to create compound types... people can do it
>>>>> other
>>>>> ways.
>>>>>
>>>>> -Yonik
>>>>> http://www.lucidimagination.com
>>>>>
>>>>>
>>>>
>>>> When I replied to ask if that meant the changes wouldn't be included, I
>>>> got no response. As there's been no activity in JIRA, I didn't bother
>>>> putting any of my other changes into JIRA as they all relied on that
>>>> one.
>>>> Mark
>>>>
>>>>
>
> --
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>
>

Re: how to create a custom type in Solr

Posted by Mark Allan <ma...@ed.ac.uk>.
Hi Thomas,

Sorry for not replying before now - I've had your email flagged in my  
mail client to remind me to reply, but I've been so busy recently I  
never got round to it.

I'll package up the necessary java files and send you the attachment  
directly instead of posting a zip file to the mailing list, which in  
most places would be against list etiquette.

Mark

On 16 Aug 2010, at 3:01 pm, Thomas Joiner wrote:

> Sorry to bother you, but since I haven't had a reply in a week, I  
> figured
> I'd try asking again...
>
> What build of Solr are you using personally?  Are you just using a  
> nightly
> build, or is there a specific build that you are using?  Has it had  
> any
> major screw-ups for you?
>
> And I still would love to see your code.
>
> Regards,
> Thomas
>
> On Mon, Aug 9, 2010 at 8:50 AM, Thomas Joiner <thomas.b.joiner@gmail.com 
> >wrote:
>
>> I'd love to see your code on this, however what I've really been  
>> wondering
>> is the following: When did AbstractSubTypeFieldType get added?  It  
>> isn't in
>> 1.4.1 (as far as I can tell that's the latest one that is bundled  
>> on their
>> site).  So, do I just need to grab it from subversion, and build  
>> it?  And if
>> so, is there a particular revision that I should go with?  Or  
>> should I just
>> pull trunk and use that, and last of all, is trunk stable enough to  
>> be used
>> in production?
>>
>> Regards,
>> Thomas
>>
>>
>> On Mon, Aug 9, 2010 at 8:38 AM, Mark Allan <ma...@ed.ac.uk>  
>> wrote:
>>
>>> On 9 Aug 2010, at 1:01 pm, Otis Gospodnetic wrote:
>>>
>>> Mark,
>>>>
>>>> A good way to get your changes/improvements into Solr is by  
>>>> putting them
>>>> in
>>>> JIRA.  Please see http://wiki.apache.org/solr/HowToContribute
>>>>
>>>> Thanks!
>>>> Otis
>>>>
>>>
>>>
>>> Hi Otis,
>>>
>>> For the class which requires only minor modifications, I tested it  
>>> to
>>> ensure it doesn't break existing compatibility/functionality, and  
>>> then I
>>> created an issue in JIRA and uploaded a patch:
>>>       https://issues.apache.org/jira/browse/SOLR-1986
>>>
>>> I then posted a message about it to the list and got the following
>>> responses.
>>>
>>> On 7 Jul 2010, at 6:24 pm, Yonik Seeley wrote:
>>>
>>>> On Wed, Jul 7, 2010 at 8:15 AM, Grant Ingersoll <gsingers@apache.org 
>>>> >
>>>> wrote:
>>>>
>>>>> Originally, I had intended that it was just for one Field Sub  
>>>>> Type,
>>>>> thinking that if we ever wanted multiple sub types, that a new,  
>>>>> separate
>>>>> class would be needed
>>>>>
>>>>
>>>> Right - this was my original thinking too.   
>>>> AbstractSubTypeFieldType is
>>>> only a convenience class to create compound types... people can  
>>>> do it other
>>>> ways.
>>>>
>>>> -Yonik
>>>> http://www.lucidimagination.com
>>>>
>>>
>>>
>>> When I replied to ask if that meant the changes wouldn't be  
>>> included, I
>>> got no response. As there's been no activity in JIRA, I didn't  
>>> bother
>>> putting any of my other changes into JIRA as they all relied on  
>>> that one.
>>> Mark
>>>


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


Re: how to create a custom type in Solr

Posted by Thomas Joiner <th...@gmail.com>.
Sorry to bother you, but since I haven't had a reply in a week, I figured
I'd try asking again...

What build of Solr are you using personally?  Are you just using a nightly
build, or is there a specific build that you are using?  Has it had any
major screw-ups for you?

And I still would love to see your code.

Regards,
Thomas

On Mon, Aug 9, 2010 at 8:50 AM, Thomas Joiner <th...@gmail.com>wrote:

> I'd love to see your code on this, however what I've really been wondering
> is the following: When did AbstractSubTypeFieldType get added?  It isn't in
> 1.4.1 (as far as I can tell that's the latest one that is bundled on their
> site).  So, do I just need to grab it from subversion, and build it?  And if
> so, is there a particular revision that I should go with?  Or should I just
> pull trunk and use that, and last of all, is trunk stable enough to be used
> in production?
>
> Regards,
> Thomas
>
>
> On Mon, Aug 9, 2010 at 8:38 AM, Mark Allan <ma...@ed.ac.uk> wrote:
>
>> On 9 Aug 2010, at 1:01 pm, Otis Gospodnetic wrote:
>>
>>  Mark,
>>>
>>> A good way to get your changes/improvements into Solr is by putting them
>>> in
>>> JIRA.  Please see http://wiki.apache.org/solr/HowToContribute
>>>
>>> Thanks!
>>> Otis
>>>
>>
>>
>> Hi Otis,
>>
>> For the class which requires only minor modifications, I tested it to
>> ensure it doesn't break existing compatibility/functionality, and then I
>> created an issue in JIRA and uploaded a patch:
>>        https://issues.apache.org/jira/browse/SOLR-1986
>>
>> I then posted a message about it to the list and got the following
>> responses.
>>
>> On 7 Jul 2010, at 6:24 pm, Yonik Seeley wrote:
>>
>>> On Wed, Jul 7, 2010 at 8:15 AM, Grant Ingersoll <gs...@apache.org>
>>> wrote:
>>>
>>>> Originally, I had intended that it was just for one Field Sub Type,
>>>> thinking that if we ever wanted multiple sub types, that a new, separate
>>>> class would be needed
>>>>
>>>
>>> Right - this was my original thinking too.  AbstractSubTypeFieldType is
>>> only a convenience class to create compound types... people can do it other
>>> ways.
>>>
>>> -Yonik
>>> http://www.lucidimagination.com
>>>
>>
>>
>> When I replied to ask if that meant the changes wouldn't be included, I
>> got no response. As there's been no activity in JIRA, I didn't bother
>> putting any of my other changes into JIRA as they all relied on that one.
>> Mark
>>
>>
>> --
>> The University of Edinburgh is a charitable body, registered in
>> Scotland, with registration number SC005336.
>>
>>
>

Re: how to create a custom type in Solr

Posted by Thomas Joiner <th...@gmail.com>.
I'd love to see your code on this, however what I've really been wondering
is the following: When did AbstractSubTypeFieldType get added?  It isn't in
1.4.1 (as far as I can tell that's the latest one that is bundled on their
site).  So, do I just need to grab it from subversion, and build it?  And if
so, is there a particular revision that I should go with?  Or should I just
pull trunk and use that, and last of all, is trunk stable enough to be used
in production?

Regards,
Thomas

On Mon, Aug 9, 2010 at 8:38 AM, Mark Allan <ma...@ed.ac.uk> wrote:

> On 9 Aug 2010, at 1:01 pm, Otis Gospodnetic wrote:
>
>  Mark,
>>
>> A good way to get your changes/improvements into Solr is by putting them
>> in
>> JIRA.  Please see http://wiki.apache.org/solr/HowToContribute
>>
>> Thanks!
>> Otis
>>
>
>
> Hi Otis,
>
> For the class which requires only minor modifications, I tested it to
> ensure it doesn't break existing compatibility/functionality, and then I
> created an issue in JIRA and uploaded a patch:
>        https://issues.apache.org/jira/browse/SOLR-1986
>
> I then posted a message about it to the list and got the following
> responses.
>
> On 7 Jul 2010, at 6:24 pm, Yonik Seeley wrote:
>
>> On Wed, Jul 7, 2010 at 8:15 AM, Grant Ingersoll <gs...@apache.org>
>> wrote:
>>
>>> Originally, I had intended that it was just for one Field Sub Type,
>>> thinking that if we ever wanted multiple sub types, that a new, separate
>>> class would be needed
>>>
>>
>> Right - this was my original thinking too.  AbstractSubTypeFieldType is
>> only a convenience class to create compound types... people can do it other
>> ways.
>>
>> -Yonik
>> http://www.lucidimagination.com
>>
>
>
> When I replied to ask if that meant the changes wouldn't be included, I got
> no response. As there's been no activity in JIRA, I didn't bother putting
> any of my other changes into JIRA as they all relied on that one.
> Mark
>
>
> --
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>
>

Re: how to create a custom type in Solr

Posted by Mark Allan <ma...@ed.ac.uk>.
On 9 Aug 2010, at 1:01 pm, Otis Gospodnetic wrote:

> Mark,
>
> A good way to get your changes/improvements into Solr is by putting  
> them in
> JIRA.  Please see http://wiki.apache.org/solr/HowToContribute
>
> Thanks!
> Otis


Hi Otis,

For the class which requires only minor modifications, I tested it to  
ensure it doesn't break existing compatibility/functionality, and then  
I created an issue in JIRA and uploaded a patch:
	https://issues.apache.org/jira/browse/SOLR-1986

I then posted a message about it to the list and got the following  
responses.

On 7 Jul 2010, at 6:24 pm, Yonik Seeley wrote:
> On Wed, Jul 7, 2010 at 8:15 AM, Grant Ingersoll  
> <gs...@apache.org> wrote:
>> Originally, I had intended that it was just for one Field Sub Type,  
>> thinking that if we ever wanted multiple sub types, that a new,  
>> separate class would be needed
>
> Right - this was my original thinking too.  AbstractSubTypeFieldType  
> is only a convenience class to create compound types... people can  
> do it other ways.
>
> -Yonik
> http://www.lucidimagination.com


When I replied to ask if that meant the changes wouldn't be included,  
I got no response. As there's been no activity in JIRA, I didn't  
bother putting any of my other changes into JIRA as they all relied on  
that one.
Mark


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


Re: how to create a custom type in Solr

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Mark,

A good way to get your changes/improvements into Solr is by putting them in 
JIRA.  Please see http://wiki.apache.org/solr/HowToContribute

Thanks!
Otis
----
Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
Lucene ecosystem search :: http://search-lucene.com/



----- Original Message ----
> From: Mark Allan <ma...@ed.ac.uk>
> To: solr-user@lucene.apache.org
> Sent: Mon, August 9, 2010 4:04:29 AM
> Subject: Re: how to create a custom type in Solr
> 
> I see you have the exact same requirements I did and have also hit the same  
>problem I did a month-or-so ago.  I ended up writing a custom field type  based 
>on solr.schema.PointType and making some very minor modifications to one  of the 
>Solr classes (AbstractSubfieldType) to allow the field a certain degree  of 
>repeatability without affecting existing functionality.
> 
> I offered my  modifications to the list but no-one seemed interested.  Let me 
>know if you  want the code and a walkthrough of what it does.
> 
> Mark
> 
> On 7 Aug  2010, at 3:36 am, Lance Norskog wrote:
> 
> > Use OR between multiple  ranges.
> > 
> > On Fri, Aug 6, 2010 at 8:52 AM, Thomas Joiner <th...@gmail.com>  
>wrote:
> >> This will work for a single range.  However, I may need  to support 
multiple
> >> ranges, is there a way to do that?
> >> 
> >> On Fri, Aug 6, 2010 at 10:49 AM, Jan Høydahl / Cominvent  <
> >> jan.asf@cominvent.com>  wrote:
> >> 
> >>> Your use case can be solved by splitting the  range into two int's:
> >>> 
> >>> Document: {title: My  document, from: 8000, to: 9000}
> >>> Query: q=title:"My" AND (from:[*  TO 8500] AND to:[8500 TO *])
> >>> 
> >>> --
> >>>  Jan Høydahl, search solution architect
> >>> Cominvent AS -  www.cominvent.com
> >>> Training in Europe -  www.solrtraining.com
> >>> 
> >>> On 6. aug. 2010, at 17.02,  Thomas Joiner wrote:
> >>> 
> >>>> I need to have a field  that supports ranges...for instance, you specify 
a
> >>>> range of  8000 to 9000 and if you search for 8500, it will hit.   
However,
> >>>> when googling, I really couldn't find any resources  on how to create 
your
> >>>> own field type in  Solr.
> >>>> 
> >>>> But from what I was able to find,  the AbstractSubTypeFieldType class
> >>> seems
> >>>>  like a good starting point for the type that I want to make, however  
>that
> >>>> isn't in the current version of Solr that I am using  (1.4.1).  So I 
guess
> >>> my
> >>>> question is: is  Solr 3.0 ready for production?  If so, how do I get it?
> >>> Do  I
> >>>> just need to checkout the code from svn and build it  myself?  If so
> >>> should I
> >>>> just check out  the latest, or is there a particular branch that I should
> >>>  go
> >>>> with that is reliable?  If I switch to 3.0, will I  need to reindex my
> >>> data,
> >>>> or has the data  format not changed?
> >>>> 
> >>>> And if 3.0 isn't  ready for production, what would you suggest I do?  Is
> >>>  the
> >>>> AbstractSubTypeFieldType such that I can backport it and  use it with
> >>> 1.4.1,
> >>>> or does it use specific  features of 3.0 that I would have to backport as
> >>>> well, in  which case it would become a horribly convoluted mess where I
> >>>  would
> >>>> be better off just going with 3.0.  And I guess  this comes back to help
> >>> on
> >>>> finding resources  about implementing custom types...it would just be 
more
> >>>>  complicated if I couldn't use the AbstractSubTypeFieldType.
> >>>> 
> >>>> (This is my first time posting to a mailing list, so if I  have violated
> >>>> horribly some etiquette of mailing lists,  please tell me).
> >>>> 
> >>>>  Regards,
> >>>> Thomas
> 
> 
> --The University of Edinburgh is  a charitable body, registered in
> Scotland, with registration number  SC005336.
> 
> 

Re: how to create a custom type in Solr

Posted by Mark Allan <ma...@ed.ac.uk>.
I see you have the exact same requirements I did and have also hit the  
same problem I did a month-or-so ago.  I ended up writing a custom  
field type based on solr.schema.PointType and making some very minor  
modifications to one of the Solr classes (AbstractSubfieldType) to  
allow the field a certain degree of repeatability without affecting  
existing functionality.

I offered my modifications to the list but no-one seemed interested.   
Let me know if you want the code and a walkthrough of what it does.

Mark

On 7 Aug 2010, at 3:36 am, Lance Norskog wrote:

> Use OR between multiple ranges.
>
> On Fri, Aug 6, 2010 at 8:52 AM, Thomas Joiner <thomas.b.joiner@gmail.com 
> > wrote:
>> This will work for a single range.  However, I may need to support  
>> multiple
>> ranges, is there a way to do that?
>>
>> On Fri, Aug 6, 2010 at 10:49 AM, Jan Høydahl / Cominvent <
>> jan.asf@cominvent.com> wrote:
>>
>>> Your use case can be solved by splitting the range into two int's:
>>>
>>> Document: {title: My document, from: 8000, to: 9000}
>>> Query: q=title:"My" AND (from:[* TO 8500] AND to:[8500 TO *])
>>>
>>> --
>>> Jan Høydahl, search solution architect
>>> Cominvent AS - www.cominvent.com
>>> Training in Europe - www.solrtraining.com
>>>
>>> On 6. aug. 2010, at 17.02, Thomas Joiner wrote:
>>>
>>>> I need to have a field that supports ranges...for instance, you  
>>>> specify a
>>>> range of 8000 to 9000 and if you search for 8500, it will hit.   
>>>> However,
>>>> when googling, I really couldn't find any resources on how to  
>>>> create your
>>>> own field type in Solr.
>>>>
>>>> But from what I was able to find, the AbstractSubTypeFieldType  
>>>> class
>>> seems
>>>> like a good starting point for the type that I want to make,  
>>>> however that
>>>> isn't in the current version of Solr that I am using (1.4.1).  So  
>>>> I guess
>>> my
>>>> question is: is Solr 3.0 ready for production?  If so, how do I  
>>>> get it?
>>> Do I
>>>> just need to checkout the code from svn and build it myself?  If so
>>> should I
>>>> just check out the latest, or is there a particular branch that I  
>>>> should
>>> go
>>>> with that is reliable?  If I switch to 3.0, will I need to  
>>>> reindex my
>>> data,
>>>> or has the data format not changed?
>>>>
>>>> And if 3.0 isn't ready for production, what would you suggest I  
>>>> do?  Is
>>> the
>>>> AbstractSubTypeFieldType such that I can backport it and use it  
>>>> with
>>> 1.4.1,
>>>> or does it use specific features of 3.0 that I would have to  
>>>> backport as
>>>> well, in which case it would become a horribly convoluted mess  
>>>> where I
>>> would
>>>> be better off just going with 3.0.  And I guess this comes back  
>>>> to help
>>> on
>>>> finding resources about implementing custom types...it would just  
>>>> be more
>>>> complicated if I couldn't use the AbstractSubTypeFieldType.
>>>>
>>>> (This is my first time posting to a mailing list, so if I have  
>>>> violated
>>>> horribly some etiquette of mailing lists, please tell me).
>>>>
>>>> Regards,
>>>> Thomas


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


Re: how to create a custom type in Solr

Posted by Lance Norskog <go...@gmail.com>.
Use OR between multiple ranges.

On Fri, Aug 6, 2010 at 8:52 AM, Thomas Joiner <th...@gmail.com> wrote:
> This will work for a single range.  However, I may need to support multiple
> ranges, is there a way to do that?
>
> On Fri, Aug 6, 2010 at 10:49 AM, Jan Høydahl / Cominvent <
> jan.asf@cominvent.com> wrote:
>
>> Your use case can be solved by splitting the range into two int's:
>>
>> Document: {title: My document, from: 8000, to: 9000}
>> Query: q=title:"My" AND (from:[* TO 8500] AND to:[8500 TO *])
>>
>> --
>> Jan Høydahl, search solution architect
>> Cominvent AS - www.cominvent.com
>> Training in Europe - www.solrtraining.com
>>
>> On 6. aug. 2010, at 17.02, Thomas Joiner wrote:
>>
>> > I need to have a field that supports ranges...for instance, you specify a
>> > range of 8000 to 9000 and if you search for 8500, it will hit.  However,
>> > when googling, I really couldn't find any resources on how to create your
>> > own field type in Solr.
>> >
>> > But from what I was able to find, the AbstractSubTypeFieldType class
>> seems
>> > like a good starting point for the type that I want to make, however that
>> > isn't in the current version of Solr that I am using (1.4.1).  So I guess
>> my
>> > question is: is Solr 3.0 ready for production?  If so, how do I get it?
>> Do I
>> > just need to checkout the code from svn and build it myself?  If so
>> should I
>> > just check out the latest, or is there a particular branch that I should
>> go
>> > with that is reliable?  If I switch to 3.0, will I need to reindex my
>> data,
>> > or has the data format not changed?
>> >
>> > And if 3.0 isn't ready for production, what would you suggest I do?  Is
>> the
>> > AbstractSubTypeFieldType such that I can backport it and use it with
>> 1.4.1,
>> > or does it use specific features of 3.0 that I would have to backport as
>> > well, in which case it would become a horribly convoluted mess where I
>> would
>> > be better off just going with 3.0.  And I guess this comes back to help
>> on
>> > finding resources about implementing custom types...it would just be more
>> > complicated if I couldn't use the AbstractSubTypeFieldType.
>> >
>> > (This is my first time posting to a mailing list, so if I have violated
>> > horribly some etiquette of mailing lists, please tell me).
>> >
>> > Regards,
>> > Thomas
>>
>>
>



-- 
Lance Norskog
goksron@gmail.com

Re: how to create a custom type in Solr

Posted by Thomas Joiner <th...@gmail.com>.
This will work for a single range.  However, I may need to support multiple
ranges, is there a way to do that?

On Fri, Aug 6, 2010 at 10:49 AM, Jan Høydahl / Cominvent <
jan.asf@cominvent.com> wrote:

> Your use case can be solved by splitting the range into two int's:
>
> Document: {title: My document, from: 8000, to: 9000}
> Query: q=title:"My" AND (from:[* TO 8500] AND to:[8500 TO *])
>
> --
> Jan Høydahl, search solution architect
> Cominvent AS - www.cominvent.com
> Training in Europe - www.solrtraining.com
>
> On 6. aug. 2010, at 17.02, Thomas Joiner wrote:
>
> > I need to have a field that supports ranges...for instance, you specify a
> > range of 8000 to 9000 and if you search for 8500, it will hit.  However,
> > when googling, I really couldn't find any resources on how to create your
> > own field type in Solr.
> >
> > But from what I was able to find, the AbstractSubTypeFieldType class
> seems
> > like a good starting point for the type that I want to make, however that
> > isn't in the current version of Solr that I am using (1.4.1).  So I guess
> my
> > question is: is Solr 3.0 ready for production?  If so, how do I get it?
> Do I
> > just need to checkout the code from svn and build it myself?  If so
> should I
> > just check out the latest, or is there a particular branch that I should
> go
> > with that is reliable?  If I switch to 3.0, will I need to reindex my
> data,
> > or has the data format not changed?
> >
> > And if 3.0 isn't ready for production, what would you suggest I do?  Is
> the
> > AbstractSubTypeFieldType such that I can backport it and use it with
> 1.4.1,
> > or does it use specific features of 3.0 that I would have to backport as
> > well, in which case it would become a horribly convoluted mess where I
> would
> > be better off just going with 3.0.  And I guess this comes back to help
> on
> > finding resources about implementing custom types...it would just be more
> > complicated if I couldn't use the AbstractSubTypeFieldType.
> >
> > (This is my first time posting to a mailing list, so if I have violated
> > horribly some etiquette of mailing lists, please tell me).
> >
> > Regards,
> > Thomas
>
>

Re: how to create a custom type in Solr

Posted by Jan Høydahl / Cominvent <ja...@cominvent.com>.
Your use case can be solved by splitting the range into two int's:

Document: {title: My document, from: 8000, to: 9000}
Query: q=title:"My" AND (from:[* TO 8500] AND to:[8500 TO *])

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com
Training in Europe - www.solrtraining.com

On 6. aug. 2010, at 17.02, Thomas Joiner wrote:

> I need to have a field that supports ranges...for instance, you specify a
> range of 8000 to 9000 and if you search for 8500, it will hit.  However,
> when googling, I really couldn't find any resources on how to create your
> own field type in Solr.
> 
> But from what I was able to find, the AbstractSubTypeFieldType class seems
> like a good starting point for the type that I want to make, however that
> isn't in the current version of Solr that I am using (1.4.1).  So I guess my
> question is: is Solr 3.0 ready for production?  If so, how do I get it? Do I
> just need to checkout the code from svn and build it myself?  If so should I
> just check out the latest, or is there a particular branch that I should go
> with that is reliable?  If I switch to 3.0, will I need to reindex my data,
> or has the data format not changed?
> 
> And if 3.0 isn't ready for production, what would you suggest I do?  Is the
> AbstractSubTypeFieldType such that I can backport it and use it with 1.4.1,
> or does it use specific features of 3.0 that I would have to backport as
> well, in which case it would become a horribly convoluted mess where I would
> be better off just going with 3.0.  And I guess this comes back to help on
> finding resources about implementing custom types...it would just be more
> complicated if I couldn't use the AbstractSubTypeFieldType.
> 
> (This is my first time posting to a mailing list, so if I have violated
> horribly some etiquette of mailing lists, please tell me).
> 
> Regards,
> Thomas