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 Anurag <an...@gmail.com> on 2011/05/10 23:11:19 UTC

search by url in Solr?

Hello everyone,
My Query
q=google.com
should give the ouput as
http://www.googe.com
In my search engine when i put q=google.com, it does not give the above
output, rather it shows no result.
but putting
q=url:google.com gives the correct output as http://www.google.com
Now my question how can i make this feature deafult. That's is when user
queries as google.com he gets the ouput as www.google.com , Also i want to
maintain Normal search features for the content search. That is , i dont
want to loose the existing features normal terms or say content search.

Please guide me


-----
Kumar Anurag

--
View this message in context: http://lucene.472066.n3.nabble.com/search-by-url-in-Solr-tp2924632p2924632.html
Sent from the Solr - User mailing list archive at Nabble.com.

AW: search by url in Solr?

Posted by Martin Rödig <rm...@shi-gmbh.com>.
Hello,

if you want to have more than one searchfield, you can use the Dismax or eDismax Queryparser. There you can set more than one field to search.
Example:
<requestHandler name="standard" class="solr.SearchHandler" default="true">
	<lst name="defaults">
		<str name="defType">dismax</str>
		<str name="echoParams">explicit</str>
		<str name="fl">*,score</str>
		<str name="qf">text^1.0 title^0.05 author^0.2 shi_quelle^0.4 shi_year adrp_keywords^0.5 shi_path^2.0</str>
		...

Qf are the Query fields in wich the parser will search.
The numbers with the ^ are boost Factors.

The Dismax have many more nice features look at it on http://wiki.apache.org/solr/DisMaxQParserPlugin

Mit freundlichen Grüßen
M.Sc. Dipl.-Inf. (FH) Martin Rödig
 
SHI Elektronische Medien GmbH

Postadresse: Watzmannstr. 23, 86316 Friedberg
Besuchsadresse: Curt-Frenzel-Str. 12, 86167 Augsburg
Tel.: 0821 7482633 18
Tel.: 0821 7482633 0 (Zentrale)
Fax: 0821 7482633 29

Internet: http://www.shi-gmbh.com
Registergericht Augsburg HRB 17382
Geschäftsführer: Peter Spiske
Steuernummer: 103/137/30412

-----Ursprüngliche Nachricht-----
Von: Anurag [mailto:anurag.it.jolly@gmail.com] 
Gesendet: Mittwoch, 11. Mai 2011 07:05
An: solr-user@lucene.apache.org
Betreff: Re: search by url in Solr?

thanks! , it worked.
Can i mention
 <defaultSearchField>url,content</
defaultSearchField>
to inlcude two default fields.?

On Wed, May 11, 2011 at 3:02 AM, Rakudten [via Lucene] <
ml-node+2924686-576776982-146354@n3.nabble.com> wrote:

> Hello.
>
> One option is to specify a default search field in your schema.xml. If 
> your
>
> query doesn´t include an specific field the query parser will use the 
> default one to launch the query. You should include in your schema.xml 
> something like this:
>
>
>     <!-- field for the QueryParser to use when an explicit fieldname 
> is absent -->
>
>  <defaultSearchField>url</defaultSearchField>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the 
> discussion
> below:
>
> http://lucene.472066.n3.nabble.com/search-by-url-in-Solr-tp2924632p292
> 4686.html  To unsubscribe from search by url in Solr?, click 
> here<http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2924632&code=YW51cmFnLml0LmpvbGx5QGdtYWlsLmNvbXwyOTI0NjMyfC0yMDk4MzQ0MTk2>.
>
>



--
Kumar Anurag


-----
Kumar Anurag

--
View this message in context: http://lucene.472066.n3.nabble.com/search-by-url-in-Solr-tp2924632p2926107.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: search by url in Solr?

Posted by Ahmet Arslan <io...@yahoo.com>.
> Can i mention
>  <defaultSearchField>url,content</
> defaultSearchField>
> to inlcude two default fields.?


No you cannot define two fields. Though you can change default field via URL with &df= parameter.

If you want to query multiple fields you may consider using (e)dismax.
http://wiki.apache.org/solr/DisMaxQParserPlugin

Re: search by url in Solr?

Posted by Anurag <an...@gmail.com>.
thanks! , it worked.
Can i mention
 <defaultSearchField>url,content</
defaultSearchField>
to inlcude two default fields.?

On Wed, May 11, 2011 at 3:02 AM, Rakudten [via Lucene] <
ml-node+2924686-576776982-146354@n3.nabble.com> wrote:

> Hello.
>
> One option is to specify a default search field in your schema.xml. If your
>
> query doesn´t include an specific field the query parser will use the
> default one to launch the query. You should include in your schema.xml
> something like this:
>
>
>     <!-- field for the QueryParser to use when an explicit fieldname is
> absent -->
>
>  <defaultSearchField>url</defaultSearchField>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://lucene.472066.n3.nabble.com/search-by-url-in-Solr-tp2924632p2924686.html
>  To unsubscribe from search by url in Solr?, click here<http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2924632&code=YW51cmFnLml0LmpvbGx5QGdtYWlsLmNvbXwyOTI0NjMyfC0yMDk4MzQ0MTk2>.
>
>



-- 
Kumar Anurag


-----
Kumar Anurag

--
View this message in context: http://lucene.472066.n3.nabble.com/search-by-url-in-Solr-tp2924632p2926107.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: search by url in Solr?

Posted by Luis Cappa Banda <lu...@gmail.com>.
Hello.

One option is to specify a default search field in your schema.xml. If your
query doesn´t include an specific field the query parser will use the
default one to launch the query. You should include in your schema.xml
something like this:


    <!-- field for the QueryParser to use when an explicit fieldname is
absent -->

 <defaultSearchField>url</defaultSearchField>