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 servus01 <fr...@sportcast.de> on 2018/05/31 13:19:26 UTC

search q via dynamic string depends on date

Hey,

digging the web for a while now to find a solution due to a complex search
string.

what i've got:

xml file with a date/description fields which are not part of the index:

(start-date-time="2018-04-01T18:00:00.000+02:00" code-name="MD 28")
(start-date-time="2018-04-07T15:00:00.000+02:00" code-name="MD 29")
(start-date-time="2018-04-12T18:30:00.000+02:00" code-name="MD 30")

what i want to have is a query string which checks the xml document against
the actual date to query my solr search like this:

select?q=*Goals*&fq=roundTypeWithIndex%3A*insert actual/latest MD
here*&wt=json&indent=true&start=0&rows=50&facet=true

Is there any kind of possibility to do this by solr itself or i would really
appriciate any kind of solution on this.

Thanks

Francois



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: search q via dynamic string depends on date

Posted by Emir Arnautović <em...@sematext.com>.
Sorry Francois but I still don’t get it. Is your problem building a query or retrieving results from Solr? If it is building query, then it seems like your custom logic. You might be able to index more things is Solr and move that logic in Solr, but I really don’t get what is in your Test index, what you try to get from index and what is the problem.

Maybe explaining what this query returns and what you would like it to return would help.

Thanks
Emir
--
Monitoring - Log Management - Alerting - Anomaly Detection
Solr & Elasticsearch Consulting Support Training - http://sematext.com/



> On 1 Jun 2018, at 13:04, servus01 <fr...@sportcast.de> wrote:
> 
> Hey Emir,
> 
> yes of course. My problem is more related to dynamic data in the search
> string.
> 
> I have an xml which is not part of my solr index and has matchday data e.g.:
> 
>> (start-date-time="2018-04-01T18:00:00.000+02:00" code-name="MD 28") 
>> (start-date-time="2018-04-07T15:00:00.000+02:00" code-name="MD 29") 
>> (start-date-time="2018-04-12T18:30:00.000+02:00" code-name="MD 30") 
> 
> And i have my solr index which contains data ralated to that "MD ..". I'am
> looking for an possibility to do an one click/link query which checks actual
> date against the matchday data to get the latest matchday and search with
> this on my index.
> 
> E.g. today is 01. June, so latest Matchday is MD30:
> 
> http://mysolrserver:9777/solr/Test/search?q=Goals*&fq=roundTypeWithIndex%3AMD30&wt=json&indent=true&start=0&rows=50&facet=true
> 
> best
> 
> Francois
> 
> 
> 
> 
> 
> 
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html


Re: search q via dynamic string depends on date

Posted by servus01 <fr...@sportcast.de>.
Hey Emir,

yes of course. My problem is more related to dynamic data in the search
string.

I have an xml which is not part of my solr index and has matchday data e.g.:

> (start-date-time="2018-04-01T18:00:00.000+02:00" code-name="MD 28") 
> (start-date-time="2018-04-07T15:00:00.000+02:00" code-name="MD 29") 
> (start-date-time="2018-04-12T18:30:00.000+02:00" code-name="MD 30") 

And i have my solr index which contains data ralated to that "MD ..". I'am
looking for an possibility to do an one click/link query which checks actual
date against the matchday data to get the latest matchday and search with
this on my index.

E.g. today is 01. June, so latest Matchday is MD30:

http://mysolrserver:9777/solr/Test/search?q=Goals*&fq=roundTypeWithIndex%3AMD30&wt=json&indent=true&start=0&rows=50&facet=true

best

Francois






--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: search q via dynamic string depends on date

Posted by Emir Arnautović <em...@sematext.com>.
Hi Francois,
I am not sure I follow your case: “which are NOT part of the index”. You have to convert your XML doc to Solr input doc and index it in order to be able to search. Alternatively, you can threat entire doc as a single field and search it using phrase search, but that solution is limited.
Also, I am not sure I understand you query. Can you explain your intention on some example.

Thanks,
Emir
--
Monitoring - Log Management - Alerting - Anomaly Detection
Solr & Elasticsearch Consulting Support Training - http://sematext.com/



> On 31 May 2018, at 15:19, servus01 <fr...@sportcast.de> wrote:
> 
> Hey,
> 
> digging the web for a while now to find a solution due to a complex search
> string.
> 
> what i've got:
> 
> xml file with a date/description fields which are not part of the index:
> 
> (start-date-time="2018-04-01T18:00:00.000+02:00" code-name="MD 28")
> (start-date-time="2018-04-07T15:00:00.000+02:00" code-name="MD 29")
> (start-date-time="2018-04-12T18:30:00.000+02:00" code-name="MD 30")
> 
> what i want to have is a query string which checks the xml document against
> the actual date to query my solr search like this:
> 
> select?q=*Goals*&fq=roundTypeWithIndex%3A*insert actual/latest MD
> here*&wt=json&indent=true&start=0&rows=50&facet=true
> 
> Is there any kind of possibility to do this by solr itself or i would really
> appriciate any kind of solution on this.
> 
> Thanks
> 
> Francois
> 
> 
> 
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html


Re: search q via dynamic string depends on date

Posted by servus01 <fr...@sportcast.de>.
Yeah shawn,

you're right. But what i hoped to get was a hint howto build this a easy
way. Maybe something like a double query with a check between.

check fq = highest match will be last matchday = query with last matchday

i will google for some php script that can do this.... if you got a hint,
feel free to show up... :)


kindest regards

Francois



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: search q via dynamic string depends on date

Posted by Shawn Heisey <ap...@elyograg.org>.
On 5/31/2018 7:19 AM, servus01 wrote:
> what i've got:
>
> xml file with a date/description fields which are not part of the index:
>
> (start-date-time="2018-04-01T18:00:00.000+02:00" code-name="MD 28")
> (start-date-time="2018-04-07T15:00:00.000+02:00" code-name="MD 29")
> (start-date-time="2018-04-12T18:30:00.000+02:00" code-name="MD 30")
>
> what i want to have is a query string which checks the xml document against
> the actual date to query my solr search like this:
>
> select?q=*Goals*&fq=roundTypeWithIndex%3A*insert actual/latest MD
> here*&wt=json&indent=true&start=0&rows=50&facet=true
>
> Is there any kind of possibility to do this by solr itself or i would really
> appriciate any kind of solution on this.

If I understand this correctly, Solr won't be able to examine your 
custom XML to build a query.

You're going to have to do this in your own code that builds queries 
before they are sent to Solr.

Thanks,
Shawn