[ 
https://issues.apache.org/jira/browse/SOLR-13759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16992166#comment-16992166
 ] 

Gus Heck commented on SOLR-13759:
---------------------------------

I think we're going to have trouble parsing the fq the way you're doing it 
here. Consider this query (bad style, but legal)....
{code:json}
"params":{
      "q":"*:*",
      "q.op":"and",
      "fq":"number_i:[40 TO 45]  dob_dt:[1980-01-01T00:00:00Z TO NOW]",
      "rows":"10"}
{code}
The fq can contain any arbitrary query, so we may need to get more fancy. Even 
so, your split on ':' that is clearly meant to parse off the field, is going to 
go badly with timestamps such as 1980-01-01T00:00:00Z. I think you're going to 
need to actually parse the query via something like:
{code:java}
        QParser parser = QParser.getParser(fq, defType, solrReq);
        Query q = parser.getQuery();
{code}
And then walk the query with a QueryVisitor... (which is a bit tricky and I 
admit I haven't done it in a while, so I don't have a ready example... I'll 
look for one) anything else is going to wind up trying to reproduce any number 
of query parsers with ever growing collections of string functions :). 
(consider what happens if they supply a localparam in the fq...). Probably 
better to let the parsers do their thing and inspect the result.

Also I think your unit test is artificially passing due to a bug in your 
isShardInRange() helper method... Definitely looks like some are out of range 
here...

!image-2019-12-09-22-45-51-721.png!

Your ResponseHelper class while nifty probably should remain a method within 
the test for now unless it seems to be required in some other class.

Your parseLocalDateTimeFromCollectionName doesn't make much sense. The query 
string would be in UTC normally , or perhaps a timezone specified by the TZ 
parameter.  We probably need to account for that, and the TZ parameter for the 
routed alias as well (can't be sure they will match), but i have trouble 
imagining circumstances where will you want ZoneId.systemDefault(). That would 
behave differently on machines installed in different locales. (I believe/hope 
this would fail precommit).  I'm wondering why parseInstantFromCollectionName 
didn't work for you?

same goes for toLocalDateTime() that you added.

 

> Optimize Queries when query filtering by TRA router.field
> ---------------------------------------------------------
>
>                 Key: SOLR-13759
>                 URL: https://issues.apache.org/jira/browse/SOLR-13759
>             Project: Solr
>          Issue Type: Sub-task
>            Reporter: mosh
>            Assignee: Gus Heck
>            Priority: Minor
>         Attachments: SOLR-13759.patch, SOLR-13759.patch, 
> image-2019-12-09-22-45-51-721.png
>
>
> We are currently testing TRA using Solr 7.7, having >300 shards in the alias, 
> with much growth in the coming months.
> The "hot" data(in our case, more recent) will be stored on stronger 
> nodes(SSD, more RAM, etc).
> A proposal of optimizing queries will be by filtering query by date range, by 
> that we will be able to querying the specific TRA collections taking 
> advantage of the TRA mechanism of partitioning data based on date.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to