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 Jai <ja...@gmail.com> on 2013/09/03 08:30:39 UTC

Solr 4.2 update/extract adding unknown field, can we change field type from string to text

hi,

while indexing document with unknown fields, its adding unknown fields in
schema but its always guessing it as string type. is it possible to specify
default field type for unknown fields to some other type, like text so that
it gets tokenized? also can we specify other properties by default like
indexed/stored/multivalued?

PS am using solr4.2.

Thanks alot.
Jai

Re: Solr 4.2 update/extract adding unknown field, can we change field type from string to text

Posted by Chris Hostetter <ho...@fucit.org>.
Your email is vague in terms of what you are actually *doing* and what 
behavior you are seeing.  

Providing specific details like "This is my schema.xml and this is my 
solrconfig.xml; when i POST this file to this URL i get this result and i 
would instead like to get this result" is useful for other people to 
provide you with meaningful help...

https://wiki.apache.org/solr/UsingMailingLists

My best guess is that you are refering specifically to the behavior of 
ExtractingRequestHandler and the fields it tries to include in documents 
that are exstracted, and how those fileds are indexed -- in which case you 
can use the "uprefix" option to add a prefix to the name of all fields 
generated by Tika that aren't already in your schema, and you can then 
define a dynamicField matching hat prefix to ontrol every aspect of the 
resulting fields...

https://cwiki.apache.org/confluence/display/solr/Uploading+Data+with+Solr+Cell+using+Apache+Tika#UploadingDatawithSolrCellusingApacheTika-InputParameters


-Hoss

Re: Solr 4.2 update/extract adding unknown field, can we change field type from string to text

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
You can use the dynamic fields feature of Solr to map unknown field
names to types.

For example, a dynamic field named as "*_s" i.e. any field name ending
with _s can be mapped to string and so on. In your cases, if your
field names do not follow a set pattern, then you can even specify a
dynamic field as "*" and map it to text type.

See https://cwiki.apache.org/confluence/display/solr/Dynamic+Fields

On Tue, Sep 3, 2013 at 12:00 PM, Jai <ja...@gmail.com> wrote:
> hi,
>
> while indexing document with unknown fields, its adding unknown fields in
> schema but its always guessing it as string type. is it possible to specify
> default field type for unknown fields to some other type, like text so that
> it gets tokenized? also can we specify other properties by default like
> indexed/stored/multivalued?
>
> PS am using solr4.2.
>
> Thanks alot.
> Jai



-- 
Regards,
Shalin Shekhar Mangar.