Hi,
you could create an additional index field res_ranked_url that contains
the concatenated value of an url and its corresponding rank, e.g.,
res_rank + " " + res_url
Then, q=res_ranked_url:"1 url1" retrieves all documents with url1 as the
first url.
A drawback of this workaround is that you have to use a phrase query
thus preventing wildcard searches for urls.
-Sascha
Hello everybody, i would like to know how to create index supporting a
parent/child mapping and then querying the child to get the results.
in other words; imagine that we have a database containing 2
tables:Keyword[id(int), value(string)] and Result[id(int), res_url(text),
res_text(tex), res_date(date), res_rank(int)]
For indexing, i used the DataImportHandler to import data and it works well,
and my query response seems good:(q=*:*) (imagine that we have only this to
keywords and their results)
<?xml version="1.0" encoding="UTF-8" ?>
-<response>
-<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">0</int>
-<lst name="params">
<str name="q">*:*</str>
</lst>
</lst>
-<result name="response" numFound="2" start="0">
-<doc>
<str name="id">1</str>
<str name="keyword">Key1</str>
-<arr name="res_url">
<str>url1</str>
<str>url2</str>
<str>url3</str>
<str>url4</str>
</arr>
-<arr name="res_rank">
<str>1</str>
<str>2</str>
<str>3</str>
<str>4</str>
</arr>
</doc>
-<doc>
<str name="id">2</str>
<str name="keyword">Key2</str>
-<arr name="res_url">
<str>url1</str>
<str>url5</str>
<str>url8</str>
<str>url7</str>
</arr>
-<arr name="res_rank">
<str>1</str>
<str>2</str>
<str>3</str>
<str>4</str>
</arr>
</doc>
</result>
</response>
but the problem is when i tape a query kind of this:"q=res_url:url2 AND
res_rank:1" and this to say that i want to search for the keywords in which
the url (url2) is ranked at the first position, i have a result like this:
<?xml version="1.0" encoding="UTF-8" ?>
-<response>
-<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">0</int>
-<lst name="params">
<str name="q">res_url:url2 AND res_rank:1</str>
</lst>
</lst>
-<result name="response" numFound="1" start="0">
-<doc>
<str name="id">1</str>
<str name="keyword">Key1</str>
-<arr name="res_url">
<str>url1</str>
<str>url2</str>
<str>url3</str>
<str>url4</str>
</arr>
-<arr name="res_rank">
<str>1</str>
<str>2</str>
<str>3</str>
<str>4</str>
</arr>
</doc>
</result>
</response>
But this is not true; because the url present in the 1st position in the
results of the keyword "key1" is url1 and not url2.
So what i want to say is : is there any solution to make the values of the
"multivalued" fields linked;
so in our case we can see that the previous result say that:
- url1 is present in 1st position of "key1" results
- url2 is present in 2nd position of "key1" results
- url3 is present in 3rd position of "key1" results
- url4 is present in 4th position of "key1" results
and i would like that solr consider this when executing queries.
Any helps please; and thanks for all :)