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 Bernd Fehling <be...@uni-bielefeld.de> on 2010/11/29 14:30:22 UTC
question about Solr SignatureUpdateProcessorFactory
Dear list,
a question about Solr SignatureUpdateProcessorFactory:
for (String field : sigFields) {
SolrInputField f = doc.getField(field);
if (f != null) {
* sig.add(field);
Object o = f.getValue();
if (o instanceof String) {
sig.add((String)o);
} else if (o instanceof Collection) {
for (Object oo : (Collection)o) {
if (oo instanceof String) {
sig.add((String)oo);
}
}
}
}
}
Why is also the field name (* above) added to the signature
and not only the content of the field?
By purpose or by accident?
I would like to suggest removing the field name from the signature and
not mixing it up.
Best regards,
Bernd
Re: question about Solr SignatureUpdateProcessorFactory
Posted by Erick Erickson <er...@gmail.com>.
Why do you want to do this? It'd be the same value, just stored in
multiple fields in the document, which seems a waste. What's
the use-case you're addressing?
Best
Erick
On Mon, Nov 29, 2010 at 8:51 AM, Bernd Fehling <
bernd.fehling@uni-bielefeld.de> wrote:
> Dear list,
> another suggestion about SignatureUpdateProcessorFactory.
>
> Why can I make signatures of several fields and place the
> result in one field but _not_ make a signature of one field
> and place the result in several fields.
>
> Could be realized without huge programming?
>
> Best regards,
> Bernd
>
>
> Am 29.11.2010 14:30, schrieb Bernd Fehling:
> > Dear list,
> >
> > a question about Solr SignatureUpdateProcessorFactory:
> >
> > for (String field : sigFields) {
> > SolrInputField f = doc.getField(field);
> > if (f != null) {
> > * sig.add(field);
> > Object o = f.getValue();
> > if (o instanceof String) {
> > sig.add((String)o);
> > } else if (o instanceof Collection) {
> > for (Object oo : (Collection)o) {
> > if (oo instanceof String) {
> > sig.add((String)oo);
> > }
> > }
> > }
> > }
> > }
> >
> > Why is also the field name (* above) added to the signature
> > and not only the content of the field?
> >
> > By purpose or by accident?
> >
> > I would like to suggest removing the field name from the signature and
> > not mixing it up.
> >
> > Best regards,
> > Bernd
>
Re: question about Solr SignatureUpdateProcessorFactory
Posted by Bernd Fehling <be...@uni-bielefeld.de>.
Am 29.11.2010 14:55, schrieb Markus Jelsma:
>
>
> On Monday 29 November 2010 14:51:33 Bernd Fehling wrote:
>> Dear list,
>> another suggestion about SignatureUpdateProcessorFactory.
>>
>> Why can I make signatures of several fields and place the
>> result in one field but _not_ make a signature of one field
>> and place the result in several fields.
>
> Use copyField
Ooooh yes, you are right.
>
>>
>> Could be realized without huge programming?
>>
>> Best regards,
>> Bernd
>>
>> Am 29.11.2010 14:30, schrieb Bernd Fehling:
>>> Dear list,
>>>
>>> a question about Solr SignatureUpdateProcessorFactory:
>>>
>>> for (String field : sigFields) {
>>>
>>> SolrInputField f = doc.getField(field);
>>> if (f != null) {
>>>
>>> * sig.add(field);
>>>
>>> Object o = f.getValue();
>>> if (o instanceof String) {
>>>
>>> sig.add((String)o);
>>>
>>> } else if (o instanceof Collection) {
>>>
>>> for (Object oo : (Collection)o) {
>>>
>>> if (oo instanceof String) {
>>>
>>> sig.add((String)oo);
>>>
>>> }
>>>
>>> }
>>>
>>> }
>>>
>>> }
>>>
>>> }
>>>
>>> Why is also the field name (* above) added to the signature
>>> and not only the content of the field?
>>>
>>> By purpose or by accident?
>>>
>>> I would like to suggest removing the field name from the signature and
>>> not mixing it up.
>>>
>>> Best regards,
>>> Bernd
>
Re: question about Solr SignatureUpdateProcessorFactory
Posted by Markus Jelsma <ma...@openindex.io>.
On Monday 29 November 2010 14:51:33 Bernd Fehling wrote:
> Dear list,
> another suggestion about SignatureUpdateProcessorFactory.
>
> Why can I make signatures of several fields and place the
> result in one field but _not_ make a signature of one field
> and place the result in several fields.
Use copyField
>
> Could be realized without huge programming?
>
> Best regards,
> Bernd
>
> Am 29.11.2010 14:30, schrieb Bernd Fehling:
> > Dear list,
> >
> > a question about Solr SignatureUpdateProcessorFactory:
> >
> > for (String field : sigFields) {
> >
> > SolrInputField f = doc.getField(field);
> > if (f != null) {
> >
> > * sig.add(field);
> >
> > Object o = f.getValue();
> > if (o instanceof String) {
> >
> > sig.add((String)o);
> >
> > } else if (o instanceof Collection) {
> >
> > for (Object oo : (Collection)o) {
> >
> > if (oo instanceof String) {
> >
> > sig.add((String)oo);
> >
> > }
> >
> > }
> >
> > }
> >
> > }
> >
> > }
> >
> > Why is also the field name (* above) added to the signature
> > and not only the content of the field?
> >
> > By purpose or by accident?
> >
> > I would like to suggest removing the field name from the signature and
> > not mixing it up.
> >
> > Best regards,
> > Bernd
--
Markus Jelsma - CTO - Openindex
http://www.linkedin.com/in/markus17
050-8536620 / 06-50258350
Re: question about Solr SignatureUpdateProcessorFactory
Posted by Bernd Fehling <be...@uni-bielefeld.de>.
Dear list,
another suggestion about SignatureUpdateProcessorFactory.
Why can I make signatures of several fields and place the
result in one field but _not_ make a signature of one field
and place the result in several fields.
Could be realized without huge programming?
Best regards,
Bernd
Am 29.11.2010 14:30, schrieb Bernd Fehling:
> Dear list,
>
> a question about Solr SignatureUpdateProcessorFactory:
>
> for (String field : sigFields) {
> SolrInputField f = doc.getField(field);
> if (f != null) {
> * sig.add(field);
> Object o = f.getValue();
> if (o instanceof String) {
> sig.add((String)o);
> } else if (o instanceof Collection) {
> for (Object oo : (Collection)o) {
> if (oo instanceof String) {
> sig.add((String)oo);
> }
> }
> }
> }
> }
>
> Why is also the field name (* above) added to the signature
> and not only the content of the field?
>
> By purpose or by accident?
>
> I would like to suggest removing the field name from the signature and
> not mixing it up.
>
> Best regards,
> Bernd
Re: question about Solr SignatureUpdateProcessorFactory
Posted by Bernd Fehling <be...@uni-bielefeld.de>.
> As mentioned, in the typical case it's important that the field names be
> included in the signature, but i imagine there would be cases where you
> wouldn't want them included (like a simple concat Signature for building
> basic composite keys)
>
> I think the Signature API could definitely be enhanced to have additional
> methods for adding field names vs adding field values.
>
> wanna open an issue in Jira sith some suggestions and use cases?
>
>
> -Hoss
Done.
Issue SOLR-2258 and SOLR-2258.patch as suggestion.
Best regards,
Bernd
Re: question about Solr SignatureUpdateProcessorFactory
Posted by Chris Hostetter <ho...@fucit.org>.
: Why is also the field name (* above) added to the signature
: and not only the content of the field?
:
: By purpose or by accident?
It was definitely deliberate. This way if your signature fields are
"fieldA,fieldB,fieldC" then these two documents...
Doc1:fielda:XXX
Doc1:fieldB:YYY
Doc2:fieldB:XXX
Doc2:fieldC:YYY
...don't wind up with identical signature alues
: I would like to suggest removing the field name from the signature and
: not mixing it up.
As mentioned, in the typical case it's important that the field names be
included in the signature, but i imagine there would be cases where you
wouldn't want them included (like a simple concat Signature for building
basic composite keys)
I think the Signature API could definitely be enhanced to have additional
methods for adding field names vs adding field values.
wanna open an issue in Jira sith some suggestions and use cases?
-Hoss