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 Jack Park <ja...@topicquests.org> on 2013/01/21 19:41:48 UTC

When a URL is a component of a query string's data?

There exists in my Solr index a document (several, actually) which
harbor http:// URL values. Trying to find documents with a particular
URL fails.

The query is like this:
ResourceURLPropertyType:http://someserver.org/something

Fails due to the second ":"

If I substitute %3a into that query, e.g.
ResourceURLPropertyType:http$3a//someserver.org/something
the query goes through and finds nothing.

A fork in the road?
Make it a policy to swap %3a into all URL values going to Solr, then
use the same format in search.
or
Find another way to get the query to work with the full URL,
untouched, in the index.

Googling this one has been difficult due to the ambiguity of "url" in
query strings.

Thoughts?

Many thanks in advance
Jack

Re: When a URL is a component of a query string's data?

Posted by Jack Park <ja...@topicquests.org>.
At the admin console, surrounding with "" worked fine.

Many thanks
Jack

On Mon, Jan 21, 2013 at 11:24 AM, Jack Krupansky
<ja...@basetechnology.com> wrote:
> The colons are probably okay. It is probably the slashes causing the
> problem. An embedded slash now terminates the preceding term and starts a
> regular expression term (that is terminated by a second slash).
>
> Solution: quote each slash with a backslash.
>
>    ResourceURLPropertyType:http:\/\/someserver.org\/something
>
> Or, enclose the URL in quotes.
>
>    ResourceURLPropertyType:"http://someserver.org/something"
>
> -- Jack Krupansky
>
> -----Original Message----- From: Jack Park
> Sent: Monday, January 21, 2013 1:41 PM
> To: solr-user@lucene.apache.org
> Subject: When a URL is a component of a query string's data?
>
>
> There exists in my Solr index a document (several, actually) which
> harbor http:// URL values. Trying to find documents with a particular
> URL fails.
>
> The query is like this:
> ResourceURLPropertyType:http://someserver.org/something
>
> Fails due to the second ":"
>
> If I substitute %3a into that query, e.g.
> ResourceURLPropertyType:http$3a//someserver.org/something
> the query goes through and finds nothing.
>
> A fork in the road?
> Make it a policy to swap %3a into all URL values going to Solr, then
> use the same format in search.
> or
> Find another way to get the query to work with the full URL,
> untouched, in the index.
>
> Googling this one has been difficult due to the ambiguity of "url" in
> query strings.
>
> Thoughts?
>
> Many thanks in advance
> Jack

Re: When a URL is a component of a query string's data?

Posted by Jack Krupansky <ja...@basetechnology.com>.
The colons are probably okay. It is probably the slashes causing the 
problem. An embedded slash now terminates the preceding term and starts a 
regular expression term (that is terminated by a second slash).

Solution: quote each slash with a backslash.

    ResourceURLPropertyType:http:\/\/someserver.org\/something

Or, enclose the URL in quotes.

    ResourceURLPropertyType:"http://someserver.org/something"

-- Jack Krupansky

-----Original Message----- 
From: Jack Park
Sent: Monday, January 21, 2013 1:41 PM
To: solr-user@lucene.apache.org
Subject: When a URL is a component of a query string's data?

There exists in my Solr index a document (several, actually) which
harbor http:// URL values. Trying to find documents with a particular
URL fails.

The query is like this:
ResourceURLPropertyType:http://someserver.org/something

Fails due to the second ":"

If I substitute %3a into that query, e.g.
ResourceURLPropertyType:http$3a//someserver.org/something
the query goes through and finds nothing.

A fork in the road?
Make it a policy to swap %3a into all URL values going to Solr, then
use the same format in search.
or
Find another way to get the query to work with the full URL,
untouched, in the index.

Googling this one has been difficult due to the ambiguity of "url" in
query strings.

Thoughts?

Many thanks in advance
Jack