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 MKrishna <ma...@robertbird.com> on 2017/07/29 13:15:37 UTC

Copy field from string to date

We want to use a copy field as a source for another copy field. 

The problem is source  field  is from a text (dynamic field ) and
destination field should be date
tried changing the dynamic field datatype but it throws error.

ideally my search index data source is outlook PST files as the index is
reading all date fields( properties of the files like date created,
received_date as text_general fields) making it difficult to query the
dates.

All I want is to query the date fields that are stored as string
/text_general.

Any help is really appreciated.




--
View this message in context: http://lucene.472066.n3.nabble.com/Copy-field-from-string-to-date-tp4348173.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Copy field from string to date

Posted by MKrishna <ma...@robertbird.com>.
My apologies first for posting in the wrong forum as I thought they are
internally using Solr and the the process is all same when it comes to filed
mapping etc.

And really appreciate your patience in assisting me. Thank you once again.



--
View this message in context: http://lucene.472066.n3.nabble.com/Copy-field-from-string-to-date-tp4348173p4348303.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Copy field from string to date

Posted by Erick Erickson <er...@gmail.com>.
It would have been very helpful if you'd mentioned Fusion earlier.

Fusion is a Lucidworks product, not something the Solr community can
be expected to troubleshoot. I suggest you contact Lucidworks support
for help with that.

Best,
Erick

On Sun, Jul 30, 2017 at 11:56 AM, MKrishna <ma...@robertbird.com> wrote:
> The actual setup is :
>
> Lucid works Fusion 3.1.0 (installed on a Linux machine) is the latest
> upgrade we did for the search index from fusion 2.4.Also with 2.4 we had the
> schema less mode.
>
> Basically we are indexing the outlook files stored in a  folder via smb as
> input to Lucid fusion.
>
> My application uses API to query the index and gets the result in JSON
> format and  applies additional condition before displaying to user.
>
> Please point me to any resources for mapping fields (assuming this must be
> done before we index the data).
> and what could be the issues with schema less?
>
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Copy-field-from-string-to-date-tp4348173p4348298.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: Copy field from string to date

Posted by MKrishna <ma...@robertbird.com>.
The actual setup is : 

Lucid works Fusion 3.1.0 (installed on a Linux machine) is the latest
upgrade we did for the search index from fusion 2.4.Also with 2.4 we had the
schema less mode.

Basically we are indexing the outlook files stored in a  folder via smb as
input to Lucid fusion.

My application uses API to query the index and gets the result in JSON
format and  applies additional condition before displaying to user.

Please point me to any resources for mapping fields (assuming this must be
done before we index the data).
and what could be the issues with schema less?





--
View this message in context: http://lucene.472066.n3.nabble.com/Copy-field-from-string-to-date-tp4348173p4348298.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Copy field from string to date

Posted by Erick Erickson <er...@gmail.com>.
Version 3.1 of _what_? Certainly not Solr as schemaless is not in any
3x version of Solr. So it sounds like you changed some other part of
your system. Can't help you there.

And I do not recommend schemaless mode for production. Use it to find
out what kinds of data you get, but then I'd advise you to map the
fields produced from whatever software you're using to unpack your
outlook into defined fields in Solr.

Best,
Erick

On Sun, Jul 30, 2017 at 9:13 AM, MKrishna <ma...@robertbird.com> wrote:
> We are using the schema less mode trying to parse outlook(.msg) files in an
> smb.
> and I get to see the properties of the .msg file(date_created fields )
> stored in dynamic fields date_Created_s and date_created_t.
>
> This change is seen only after upgrading the version to 3.1 as the older
> versions(2.0*) still hold dates as date fields.Can you let me know if there
> is anything to do with the parses or how do  I check if the parser is right
> ??
>
> Thanks,
> Krishna
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Copy-field-from-string-to-date-tp4348173p4348275.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: Copy field from string to date

Posted by MKrishna <ma...@robertbird.com>.
We are using the schema less mode trying to parse outlook(.msg) files in an
smb.
and I get to see the properties of the .msg file(date_created fields )
stored in dynamic fields date_Created_s and date_created_t.

This change is seen only after upgrading the version to 3.1 as the older
versions(2.0*) still hold dates as date fields.Can you let me know if there
is anything to do with the parses or how do  I check if the parser is right
??

Thanks,
Krishna 



--
View this message in context: http://lucene.472066.n3.nabble.com/Copy-field-from-string-to-date-tp4348173p4348275.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Copy field from string to date

Posted by Erick Erickson <er...@gmail.com>.
It's right there in the reference guide:
https://cwiki.apache.org/confluence/display/solr/Copying+Fields

But that's not what I was talking about, you've got it backwards

<copyField source="date_created" dest="date_created_t"/>
<copyField source="date_created" dest="date_created_s"/>

What you haven't really told us is why the data is being sent to
date_created in the first place. How are you parsing the files? Why
not just send the date to the right field in the first place?

Best,
Erick

On Sat, Jul 29, 2017 at 10:47 PM, MKrishna <ma...@robertbird.com> wrote:
> date_created field is being indexed as a string and text general making it
> difficult to apply date range queries
>
> date_created_s and date_created_t are the extensions and trying to copy them
> to *_tdate is throwing an error.
>
> "copyFields can take glob-type source specifications if that helps. "
>
> Can you give me an example for this as I want the text to be queried with
> date queries?
>
> Thanks,
> Krishna
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Copy-field-from-string-to-date-tp4348173p4348241.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: Copy field from string to date

Posted by MKrishna <ma...@robertbird.com>.
date_created field is being indexed as a string and text general making it
difficult to apply date range queries

date_created_s and date_created_t are the extensions and trying to copy them
to *_tdate is throwing an error.

"copyFields can take glob-type source specifications if that helps. "

Can you give me an example for this as I want the text to be queried with
date queries?

Thanks,
Krishna



--
View this message in context: http://lucene.472066.n3.nabble.com/Copy-field-from-string-to-date-tp4348173p4348241.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Copy field from string to date

Posted by Erick Erickson <er...@gmail.com>.
bq: We want to use a copy field as a source for another copy field.

As asked, this is not supported. You can copy the same source field to
multiple copy fields however.

copyFields can take glob-type source specifications if that helps.

It would help if you gave concrete examples. You say "date created".
How is that indexed? received_date ditto? If you have something like a
dynamic field definition *_date of type, say, "tdate" you can
copyField where the source is "*_date" for instance.

Best,
Erick

On Sat, Jul 29, 2017 at 6:15 AM, MKrishna <ma...@robertbird.com> wrote:
> We want to use a copy field as a source for another copy field.
>
> The problem is source  field  is from a text (dynamic field ) and
> destination field should be date
> tried changing the dynamic field datatype but it throws error.
>
> ideally my search index data source is outlook PST files as the index is
> reading all date fields( properties of the files like date created,
> received_date as text_general fields) making it difficult to query the
> dates.
>
> All I want is to query the date fields that are stored as string
> /text_general.
>
> Any help is really appreciated.
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Copy-field-from-string-to-date-tp4348173.html
> Sent from the Solr - User mailing list archive at Nabble.com.