url-encoded strings from Admin Query String search

2012-03-19 Thread Aaron Couch
Sorry if this is documented somewhere but I did searched a lot and couldn't
find the answer to this.

I'd like to be able to type in test queries and the /admin page but when I
do the url string created is url-encoded so that the resulting string
doesn't work.


If I type:

TEST&qf=t_FIELD_NAME

into the 'Query String' field the result is:

/select/?q=TEST%26qf%3Dt_FIELD_NAME&version=2.2&start=0&rows=10&indent=on
(provides no results)

instead of:

select/?q=TEST&qf=t_FIELD_NAME&version=2.2&start=0&rows=10&indent=on (which
provides results).

Am I missing something?


I'm using Solr Specification Version: 1.4.0.2009.10.20.08.05.56, on Ubuntu
10.04 running Tomcat6.

Any help is appreciated.

thanks,

-Aaron


Re: url-encoded strings from Admin Query String search

2012-03-21 Thread Aaron Couch
hi Franck;

Thank you for your response. I'm not sure you understand my issue however.
I have dismax on by default so am able to use query fields.

My problem is not in the queries themselves, but when they are input from
the '/admin' screen they are url-encoded.

If I take your suggestion and type in t_FIELD_NAME:TEST the ''/admin screen
I get redirected to the following:

select/?q=t_FIELD_NAME%3ATEST

instead of:

select/?q=t_FIELD_NAME:TEST

Is there a setting I should be aware of to stop the /admin screen from
url-encoding strings? Or is there a setting to allow solr to accept
url-encoded strings? Is this issue fixed in later versions after 1.4?

Thanks,

-Aaron


On Wed, Mar 21, 2012 at 11:26 AM, fbrisbart wrote:

> Hi,
>
> for your example query 'TEST&qf=t_FIELD_NAME ',
> you can simply query :
> t_FIELD_NAME:TEST
>
> If you really want to use the 'qf' parameter, it is only available for
> dismax queries ( http://wiki.apache.org/solr/DisMaxQParserPlugin ). Your
> query becomes:
> {!dismax qf=t_FIELD_NAME}TEST
>
> Have a look at the wiki (
> http://wiki.apache.org/solr/CommonQueryParameters
> ) for the syntax of your queries.
>
> Franck
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/url-encoded-strings-from-Admin-Query-String-search-tp3840910p3846003.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>


Re: url-encoded strings from Admin Query String search

2012-03-21 Thread Aaron Couch
Thanks again for the follow-up.

You are correct that '%3A' and ':' are equivalent. However if I type
anything else, for example if I want to change the query parser to Lucene,
the responseHeader returns an empty set.

If I type in the /admin screen:

t_FIELD_NAME:TEST&defType=lucene

I get:

select/?q=t_title%3Aweb%26defType%3Dlucene

The '&' and '%26' are not equivalent as well as the '=' and '%3D'.

I know I could easily just type the queries correctly in the URL, but I'm
giving a training where I'd like to show how the queries generated in our
application can be tested and it would be great to be able to use the
/admin screen or have a good reason why we can't.

Thanks again,

-Aaron

On Wed, Mar 21, 2012 at 1:52 PM, fbrisbart wrote:

> I'm not sure to understand your problem.
> The 2 urls :
> .../select/?q=t_FIELD_NAME%3ATEST
> and .../select/?q=t_FIELD_NAME:TEST
>
> are strictly the same.
>
> Look in the 'responseHeader', you'll see that query received is
> t_FIELD_NAME:TEST for both urls.
>
>
> Franck
>
>
> Le mercredi 21 mars 2012 à 12:36 -0500, Aaron Couch a écrit :
> > hi Franck;
> >
> > Thank you for your response. I'm not sure you understand my issue
> however.
> > I have dismax on by default so am able to use query fields.
> >
> > My problem is not in the queries themselves, but when they are input from
> > the '/admin' screen they are url-encoded.
> >
> > If I take your suggestion and type in t_FIELD_NAME:TEST the ''/admin
> screen
> > I get redirected to the following:
> >
> > select/?q=t_FIELD_NAME%3ATEST
> >
> > instead of:
> >
> > select/?q=t_FIELD_NAME:TEST
> >
> > Is there a setting I should be aware of to stop the /admin screen from
> > url-encoding strings? Or is there a setting to allow solr to accept
> > url-encoded strings? Is this issue fixed in later versions after 1.4?
> >
> > Thanks,
> >
> > -Aaron
> >
> >
> > On Wed, Mar 21, 2012 at 11:26 AM, fbrisbart  >wrote:
> >
> > > Hi,
> > >
> > > for your example query 'TEST&qf=t_FIELD_NAME ',
> > > you can simply query :
> > > t_FIELD_NAME:TEST
> > >
> > > If you really want to use the 'qf' parameter, it is only available for
> > > dismax queries ( http://wiki.apache.org/solr/DisMaxQParserPlugin ).
> Your
> > > query becomes:
> > > {!dismax qf=t_FIELD_NAME}TEST
> > >
> > > Have a look at the wiki (
> > > http://wiki.apache.org/solr/CommonQueryParameters
> > > ) for the syntax of your queries.
> > >
> > > Franck
> > >
> > >
> > > --
> > > View this message in context:
> > >
> http://lucene.472066.n3.nabble.com/url-encoded-strings-from-Admin-Query-String-search-tp3840910p3846003.html
> > > Sent from the Solr - User mailing list archive at Nabble.com.
> > >
>
>
>


Re: url-encoded strings from Admin Query String search

2012-03-22 Thread Aaron Couch
hi Chris and Hoss:

Thanks for the feedback. This is useful to hear. This seems like a bug to
me but not a very important one.

I'm new to Solr and seems like you have a great community here.

-Aaron

On Thu, Mar 22, 2012 at 1:34 PM, Chris Hostetter
wrote:

>
> : The admin screen is made for doing a quick query against the default
> field
> : with the settings defined in the default search handler.  To that end, it
> : assumes that all entered characters should be part of the search string,
> so it
> : encodes them accordingly.
>
> correct ... that text box in question is simply the "q" param, and relies
> on defaults for everything else.  that is intentional.
>
> if you want to craft the url manally (using multiple params and taking
> care of your own escaping) you can do that directly in hte location bar --
> no need to type anything into the query form.
>
>
> -Hoss
>