|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
how can I store very specialized data ?Hello,
I have to store in one field a liste of pairs wich contains an int and a string. I tried to define my own field type but I think that currently analysers and tokenizers don't allow to do that. I checked the list here of course. Am I right ? If I am, do you know how to solve that ? (i will great and explore any path). Thanks in advance :) English is not my mother tongue :) |
|
|
Re: how can I store very specialized data ?>
> I have to store in one field a liste of pairs wich contains an int and a > string. I tried to define my own field type but I think that currently > analysers and tokenizers don't allow to do that. I checked the list > > http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters?highlight=%28tokenizer%29 > here of course. > I am not sure what your intent with the pair is? Denormalizing data for store in Solr is common practice. For searches keep your data in two different fields - id and text. For retrieving combinations, you may create a third field called "id_text" which might be an untokenized field (maybe of type string). You can use a delimiter to store data in this field (e.d idValue_textValue). Within your application you can always post-process this data to convert the same into pairs. Cheers Avlesh On Fri, Nov 6, 2009 at 8:37 PM, sophSophie <sophie@...> wrote: > > Hello, > > I have to store in one field a liste of pairs wich contains an int and a > string. I tried to define my own field type but I think that currently > analysers and tokenizers don't allow to do that. I checked the list > > http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters?highlight=%28tokenizer%29 > here of course. > > Am I right ? If I am, do you know how to solve that ? (i will great and > explore any path). > > Thanks in advance :) > > ----- > English is not my mother tongue :) > -- > View this message in context: > http://old.nabble.com/how-can-I-store-very-specialized-data---tp26230792p26230792.html > Sent from the Solr - User mailing list archive at Nabble.com. > > |
|
|
Re: how can I store very specialized data ?Hello!
The easiest way to do this (if you don't need to search this field) is to simply decide on a storage pattern and use that to store your data. For example, we might have something like this: <productData>Adidas,1</productData> And then in our code we know that split on , - the first thing is the brand name, the second the id, and so on. If you need to search on one or all of these things, you could always put that piece in it's own field as well. Would this work for your use case? --Matthew Runo On Fri, Nov 6, 2009 at 7:07 AM, sophSophie <sophie@...> wrote: > > Hello, > > I have to store in one field a liste of pairs wich contains an int and a > string. I tried to define my own field type but I think that currently > analysers and tokenizers don't allow to do that. I checked the list > http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters?highlight=%28tokenizer%29 > here of course. > > Am I right ? If I am, do you know how to solve that ? (i will great and > explore any path). > > Thanks in advance :) > > ----- > English is not my mother tongue :) > -- > View this message in context: http://old.nabble.com/how-can-I-store-very-specialized-data---tp26230792p26230792.html > Sent from the Solr - User mailing list archive at Nabble.com. > > |
|
|
Re: how can I store very specialized data ?On Fri, Nov 6, 2009 at 11:55 AM, Matthew Runo <matthew.runo@...>wrote:
> Hello! > > The easiest way to do this (if you don't need to search this field) is > to simply decide on a storage pattern and use that to store your data. > For example, we might have something like this: > > <productData>Adidas,1</productData> > > And then in our code we know that split on , - the first thing is the > brand name, the second the id, and so on. > > If you need to search on one or all of these things, you could always > put that piece in it's own field as well. > > Would this work for your use case? > > --Matthew Runo > > On Fri, Nov 6, 2009 at 7:07 AM, sophSophie <sophie@...> wrote: > > > > Hello, > > > > I have to store in one field a liste of pairs wich contains an int and a > > string. I tried to define my own field type but I think that currently > > analysers and tokenizers don't allow to do that. I checked the list > > > http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters?highlight=%28tokenizer%29 > > here of course. > > > > Am I right ? If I am, do you know how to solve that ? (i will great and > > explore any path). > > > > Thanks in advance :) > > > > ----- > > English is not my mother tongue :) > > -- > > View this message in context: > http://old.nabble.com/how-can-I-store-very-specialized-data---tp26230792p26230792.html > > Sent from the Solr - User mailing list archive at Nabble.com. > > > > > You can also use the solr.StrField type <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/> <field name="pair_field" type="string" indexed="true" stored="true" omitNorms="false" multiValued="false"/> This should store the data with any delimiters you choose as is without any modification. -- "Good Enough" is not good enough. To give anything less than your best is to sacrifice the gift. Quality First. Measure Twice. Cut Once. |
| Free embeddable forum powered by Nabble | Forum Help |