mirror of https://github.com/apache/lucene.git
SOLR-14130: Add parsing instructions for different types of query records
This commit is contained in:
parent
9d72bfc1af
commit
4c473db99d
|
@ -295,6 +295,8 @@ public class SolrLogPostTool {
|
|||
doc.addField("path_s", path);
|
||||
if(path != null && path.contains("/admin")) {
|
||||
doc.addField("type_s", "admin");
|
||||
} else if(path != null && params.contains("/replication")) {
|
||||
doc.addField("type_s", "replication");
|
||||
} else {
|
||||
doc.addField("type_s", "query");
|
||||
}
|
||||
|
@ -481,6 +483,14 @@ public class SolrLogPostTool {
|
|||
doc.addField("distrib_s", dr);
|
||||
}
|
||||
|
||||
if(parts[0].equals("shards")) {
|
||||
doc.addField("shards_s", "true");
|
||||
}
|
||||
|
||||
if(parts[0].equals("ids")) {
|
||||
doc.addField("ids_s", "true");
|
||||
}
|
||||
|
||||
if(parts[0].equals("isShard")) {
|
||||
String dr = URLDecoder.decode(parts[1], Charset.defaultCharset());
|
||||
doc.addField("isShard_s", dr);
|
||||
|
@ -496,6 +506,23 @@ public class SolrLogPostTool {
|
|||
doc.addField("facet_s", dr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Special params used to determine what stage a query is.
|
||||
//So we populate with defaults.
|
||||
//The absence of the distrib params means its a distributed query.
|
||||
|
||||
if(doc.getField("distrib_s") == null) {
|
||||
doc.addField("distrib_s", "true");
|
||||
}
|
||||
|
||||
if(doc.getField("shards_s") == null) {
|
||||
doc.addField("shards_s", "false");
|
||||
}
|
||||
|
||||
if(doc.getField("ids_s") == null) {
|
||||
doc.addField("ids_s", "false");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -51,6 +51,8 @@ public class SolrLogPostToolTest extends SolrTestCaseJ4 {
|
|||
SolrInputField wt = doc.getField("wt_s");
|
||||
SolrInputField distrib = doc.getField("distrib_s");
|
||||
SolrInputField isShard = doc.getField("isShard_s");
|
||||
SolrInputField ids = doc.getField("ids_s");
|
||||
SolrInputField shards = doc.getField("shards_s");
|
||||
|
||||
assertEquals(query.getValue(), "*:*");
|
||||
assertEquals(date.getValue(), "2019-12-09T15:05:01.931");
|
||||
|
@ -65,6 +67,9 @@ public class SolrLogPostToolTest extends SolrTestCaseJ4 {
|
|||
assertEquals(wt.getValue(), "javabin");
|
||||
assertEquals(distrib.getValue(), "false");
|
||||
assertEquals(isShard.getValue(), "true");
|
||||
assertEquals(ids.getValue(), "false");
|
||||
assertEquals(shards.getValue(), "false");
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue