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 DODMax <m....@e-deal.com> on 2008/11/13 17:39:31 UTC

DataImportHandler, custom properties

Hello,

I need somehow to add some custom properties to an entity so they will
appear with indexed datas. Something like this :

<entity>
   <field column="id" name="id" />
   <custom name="prop1" value="val1" />
</entity>

The point is that I don't have this property in the database so it can't be
imported.
Plus, I'm generating the data-source file from another database so I don't
know fields' name in advance.

Triky things I may have tried with the regex transfomers for example don't
work because column name must be existing but not already used (or it will
be replaced).
<field column="required" name="prop1" regex="(.+)" replaceWith="val1"/>

Any idea please ?
-- 
View this message in context: http://www.nabble.com/DataImportHandler%2C-custom-properties-tp20482190p20482190.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: DataImportHandler, custom properties

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>.
On Sat, Nov 15, 2008 at 5:19 AM, Lance Norskog <go...@gmail.com> wrote:
> These are what you may be asking:
> 1)
> Do you wish to read records from the database that are already indexed, and
> you want to change the fields found and leave the rest of the Solr document?
> This would certainly be a worthwhile feature; there is a separate project to
> add 'altering existing documents' in the Jira.
>
SOLR-139 and SOLR-828 are the issues currently tracking this. They are
n owhere close to a resolution AFAIK
> 2)
> Do you wish to pull both field names and values from the database and add
> those to the document? Using the Solr wildcard field name feature? One
> design pattern that inspired the Solr wildcard field name feature was to
> index products that each have some unique metadata (memory chip has speed
> etc., digital camera has resolution etc.) but the total number of tag names
> is in the thousands. It was not practical to write a schema.xml with
> thousands of field names. It is also not feasible to write a DIH config
> handler with thousands of fieldname/xpath combinations.  This would also be
> a worthwhile addition to DIH
DIH supports wild card fields . You do not have to put the .field
definition in data-config.

But you will have to write a transformer to add a column into the
returned row with the correct name.
not:There was a bug in 1.3 release , take a more recent version of DIH.
>
> Or are you trying to solve another problem?
>
> Lance
>
>
> -----Original Message-----
> From: DODMax [mailto:m.schmitt@e-deal.com]
> Sent: Friday, November 14, 2008 3:20 AM
> To: solr-user@lucene.apache.org
> Subject: Re: DataImportHandler, custom properties
>
>
>
>
>> http://wiki.apache.org/solr/DataImportHandler#head-071ff018f44ecbdb1cf
>> 55afc4c2a857f44ea1ea4
>>
>> <entity name="e" transformer="TemplateTransformer" ..> <field
>> column="namedesc" template="hello${e.name},${eparent.surname}" /> ...
>> </entity>
>>
>
> The problem is that "namedesc" must be an existing column and I have no idea
> of column name in advance.
>
> To be more clear, what I want is to be able to retrive information which are
> not in database from the index. For example to store source database in a
> kind of custom property and have it back with results.
> --
> View this message in context:
> http://www.nabble.com/DataImportHandler%2C-custom-properties-tp20482190p2049
> 8600.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>
>



-- 
--Noble Paul

RE: DataImportHandler, custom properties

Posted by Lance Norskog <go...@gmail.com>.
These are what you may be asking:
1)
Do you wish to read records from the database that are already indexed, and
you want to change the fields found and leave the rest of the Solr document?
This would certainly be a worthwhile feature; there is a separate project to
add 'altering existing documents' in the Jira.

2)
Do you wish to pull both field names and values from the database and add
those to the document? Using the Solr wildcard field name feature? One
design pattern that inspired the Solr wildcard field name feature was to
index products that each have some unique metadata (memory chip has speed
etc., digital camera has resolution etc.) but the total number of tag names
is in the thousands. It was not practical to write a schema.xml with
thousands of field names. It is also not feasible to write a DIH config
handler with thousands of fieldname/xpath combinations.  This would also be
a worthwhile addition to DIH.

Or are you trying to solve another problem?

Lance


-----Original Message-----
From: DODMax [mailto:m.schmitt@e-deal.com] 
Sent: Friday, November 14, 2008 3:20 AM
To: solr-user@lucene.apache.org
Subject: Re: DataImportHandler, custom properties




> http://wiki.apache.org/solr/DataImportHandler#head-071ff018f44ecbdb1cf
> 55afc4c2a857f44ea1ea4
> 
> <entity name="e" transformer="TemplateTransformer" ..> <field 
> column="namedesc" template="hello${e.name},${eparent.surname}" /> ...
> </entity>
> 

The problem is that "namedesc" must be an existing column and I have no idea
of column name in advance.

To be more clear, what I want is to be able to retrive information which are
not in database from the index. For example to store source database in a
kind of custom property and have it back with results.  
-- 
View this message in context:
http://www.nabble.com/DataImportHandler%2C-custom-properties-tp20482190p2049
8600.html
Sent from the Solr - User mailing list archive at Nabble.com.



Re: DataImportHandler, custom properties

Posted by DODMax <m....@e-deal.com>.


> http://wiki.apache.org/solr/DataImportHandler#head-071ff018f44ecbdb1cf55afc4c2a857f44ea1ea4
> 
> <entity name="e" transformer="TemplateTransformer" ..>
> <field column="namedesc" template="hello${e.name},${eparent.surname}" />
> ...
> </entity>
> 

The problem is that "namedesc" must be an existing column and I have no idea
of column name in advance.

To be more clear, what I want is to be able to retrive information which are
not in database from the index. For example to store source database in a
kind of custom property and have it back with results.  
-- 
View this message in context: http://www.nabble.com/DataImportHandler%2C-custom-properties-tp20482190p20498600.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: DataImportHandler, custom properties

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
I'm not very sure about what you are want to do but it seems that
TemplateTransformer can help you.

http://wiki.apache.org/solr/DataImportHandler#head-071ff018f44ecbdb1cf55afc4c2a857f44ea1ea4

On Thu, Nov 13, 2008 at 10:09 PM, DODMax <m....@e-deal.com> wrote:

>
> Hello,
>
> I need somehow to add some custom properties to an entity so they will
> appear with indexed datas. Something like this :
>
> <entity>
>   <field column="id" name="id" />
>   <custom name="prop1" value="val1" />
> </entity>
>
> The point is that I don't have this property in the database so it can't be
> imported.
> Plus, I'm generating the data-source file from another database so I don't
> know fields' name in advance.
>
> Triky things I may have tried with the regex transfomers for example don't
> work because column name must be existing but not already used (or it will
> be replaced).
> <field column="required" name="prop1" regex="(.+)" replaceWith="val1"/>
>
> Any idea please ?
> --
> View this message in context:
> http://www.nabble.com/DataImportHandler%2C-custom-properties-tp20482190p20482190.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>


-- 
Regards,
Shalin Shekhar Mangar.