Re: Solrj Exception

2008-07-09 Thread Akeel
Hi,
we have found that some of the jars (like stax-api-xxx.jar, stax-utils.jar,
stax-xxx-dev.jar, commons-codec-xxx.jar) were missing in our application's
lib directory, by adding these libraries the mentioned exception resolved.


On Tue, May 27, 2008 at 12:56 PM, Akeel <[EMAIL PROTECTED]> wrote:

> yes i have all the jar files (dependencies) in my classpath as there is not
> compile time exception neither there is any NoCalssDefExceptionError but
> there is *NoSuchMethodError* as shown below.
>
>
> On Tue, May 27, 2008 at 11:11 AM, Shalin Shekhar Mangar <
> [EMAIL PROTECTED]> wrote:
>
>> Make sure that you've included all dependencies for SolrJ in your
>> classpath. You can find all the dependencies inside dist/solrj-lib
>> folder in the binary distribution.
>>
>> On Mon, May 26, 2008 at 7:28 PM, Akeel <[EMAIL PROTECTED]> wrote:
>> > Following exception occurred while executing the line from within my
>> > application:
>> > *CommonsHttpSolrServer server = new CommonsHttpSolrServer("
>> > http://192.168.1.34:8983/solr/";);
>> > *(The class CommonsHttpSolrServer is defined in the solrj client)*
>> > *
>> > java.lang.NoSuchMethodError:
>> >
>> org.apache.commons.httpclient.HttpConnectionManager.getParams()Lorg/apache/commons/httpclient/params/HttpConnectionManagerParams;
>> >  at
>> >
>> org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.setDefaultMaxConnectionsPerHost(CommonsHttpSolrServer.java:420)
>> >  at
>> >
>> org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.(CommonsHttpSolrServer.java:123)
>> >  at
>> >
>> org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.(CommonsHttpSolrServer.java:103)
>> >  at
>> >
>> org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.(CommonsHttpSolrServer.java:79)
>> >
>> > Note: I am using nighlty build of 05-21-08 (because of solrj)
>> > Someone help me
>> >
>> > --
>> > Thanks and Regards,
>> > Akeel ur Rehman Faridee
>> > http://riseofpakistan.blogspot.com
>> > cell: 0321-4714151
>> > ====
>> > When there is injustice in society, then everyone will go to politics
>> > Except the two kinds: those who are timid and those who are materialist
>> > (Aristotle)
>> > 
>> >
>>
>>
>>
>> --
>> Regards,
>> Shalin Shekhar Mangar.
>>
>
>
>
> --
> Thanks and Regards,
> Akeel ur Rehman Faridee
> http://riseofpakistan.blogspot.com
> cell: 0321-4714151
> 
> When there is injustice in society, then everyone will go to politics
> Except the two kinds: those who are timid and those who are materialist
> (Aristotle)
> 
>


What are stopwords and protwords ???

2008-05-20 Thread Akeel
Hi,

I am a beginner to Solr, I have successfully indexed my db in solr. I want
to know that what are the stopwords and protwords ??? and how much they have
effect on my search results ?

 

Thanks in advance.

 

--

Akeel



Re: What are stopwords and protwords ???

2008-05-21 Thread Akeel
Thank you very much for such a detailed reply. can you please tell me how
can i interact with solr from within my Java/JSP application ? I mean how to
query the solr running at localhost and getting results back in the
application. Do i have to change something there in solrconfig.xml ? Please
help me in this regards

Thanks in advance

--
Akeel

On Wed, May 21, 2008 at 4:11 PM, Grant Ingersoll <[EMAIL PROTECTED]>
wrote:

> Stopwords are commonly occurring words that don't add _much_ value to
> search, such as the, an, a and are usually removed during analysis.
> Protwords (protected words) are words that would be stemmed by the English
> porter stemmer that you do not want to be stemmed.
>
> In the end, removing stopwords may keep your index smaller and can keep
> some queries from taking a long time, but they also mean you can't query for
> those words.  As for protwords, that is something you would do if you felt
> the results for those tokens was "off".
>
> Many people use stopwords, many don't.   Personally, I don't think removing
> them is the right thing to do, as there isn't always a way to recover them
> and they do provide meaning, otherwise why would they be needed in the
> language?  Often, the best thing to do, is keep stopwords, but handle them
> intelligently on the query side (in phrases, etc.).  However, since you're a
> beginner, it probably makes sense to just throw out stopwords for now.
>
> -Grant
>
>
> On May 21, 2008, at 1:50 AM, Akeel wrote:
>
>  Hi,
>>
>> I am a beginner to Solr, I have successfully indexed my db in solr. I want
>> to know that what are the stopwords and protwords ??? and how much they
>> have
>> effect on my search results ?
>>
>>
>>
>> Thanks in advance.
>>
>>
>>
>> --
>>
>> Akeel
>>
>>
>


-- 
Thanks and Regards,
Akeel ur Rehman Faridee
http://riseofpakistan.blogspot.com
cell: 0321-4714151

When there is injustice in society, then everyone will go to politics
Except the two kinds: those who are timid and those who are materialist
(Aristotle)



Re: What are stopwords and protwords ???

2008-05-21 Thread Akeel
thanks everyone

On Thu, May 22, 2008 at 7:18 AM, Grant Ingersoll <[EMAIL PROTECTED]>
wrote:

> See http://lucene.apache.org/solr/tutorial.html.  You can also see the
> wiki for a whole bunch of docs, including links to tutorials, etc.
>
> Also, just for future reference, please separate out questions so that they
> can be addressed separately, and more easily found by others in the future.
>
> -Grant
>
>
> On May 21, 2008, at 7:45 AM, Akeel wrote:
>
>  Thank you very much for such a detailed reply. can you please tell me how
>> can i interact with solr from within my Java/JSP application ? I mean how
>> to
>> query the solr running at localhost and getting results back in the
>> application. Do i have to change something there in solrconfig.xml ?
>> Please
>> help me in this regards
>>
>> Thanks in advance
>>
>> --
>> Akeel
>>
>> On Wed, May 21, 2008 at 4:11 PM, Grant Ingersoll <[EMAIL PROTECTED]>
>> wrote:
>>
>>  Stopwords are commonly occurring words that don't add _much_ value to
>>> search, such as the, an, a and are usually removed during analysis.
>>> Protwords (protected words) are words that would be stemmed by the
>>> English
>>> porter stemmer that you do not want to be stemmed.
>>>
>>> In the end, removing stopwords may keep your index smaller and can keep
>>> some queries from taking a long time, but they also mean you can't query
>>> for
>>> those words.  As for protwords, that is something you would do if you
>>> felt
>>> the results for those tokens was "off".
>>>
>>> Many people use stopwords, many don't.   Personally, I don't think
>>> removing
>>> them is the right thing to do, as there isn't always a way to recover
>>> them
>>> and they do provide meaning, otherwise why would they be needed in the
>>> language?  Often, the best thing to do, is keep stopwords, but handle
>>> them
>>> intelligently on the query side (in phrases, etc.).  However, since
>>> you're a
>>> beginner, it probably makes sense to just throw out stopwords for now.
>>>
>>> -Grant
>>>
>>>
>>> On May 21, 2008, at 1:50 AM, Akeel wrote:
>>>
>>> Hi,
>>>
>>>>
>>>> I am a beginner to Solr, I have successfully indexed my db in solr. I
>>>> want
>>>> to know that what are the stopwords and protwords ??? and how much they
>>>> have
>>>> effect on my search results ?
>>>>
>>>>
>>>>
>>>> Thanks in advance.
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Akeel
>>>>
>>>>
>>>>
>>>
>>
>> --
>> Thanks and Regards,
>> Akeel ur Rehman Faridee
>> http://riseofpakistan.blogspot.com
>> cell: 0321-4714151
>> 
>> When there is injustice in society, then everyone will go to politics
>> Except the two kinds: those who are timid and those who are materialist
>> (Aristotle)
>> 
>>
>
> --
> Grant Ingersoll
>
> Lucene Helpful Hints:
> http://wiki.apache.org/lucene-java/BasicsOfPerformance
> http://wiki.apache.org/lucene-java/LuceneFAQ
>
>
>
>
>
>
>


-- 
Thanks and Regards,
Akeel ur Rehman Faridee
http://riseofpakistan.blogspot.com
cell: 0321-4714151

When there is injustice in society, then everyone will go to politics
Except the two kinds: those who are timid and those who are materialist
(Aristotle)



How to run Solr on Linux ?

2008-06-05 Thread Akeel
Hi,

I downloaded Solr and successfully run it (by running *java -jar
start.jar *from
*example *directory) on windows machine but when i try to run it (in the
same way as i did on windows) on my linux machine, i get following error:

er.dir=/solr/example
2008-06-05 17:36:17.343::WARN:  failed SolrRequestFilter
java.lang.NoClassDefFoundError: org.apache.solr.core.SolrCore
   at java.lang.Class.initializeClass(libgcj.so.7rh)
   at
org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:75)
   at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:99)
   at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
   at org.mortbay.jetty.servlet.ServletHandle

Is there anything that i am missing ? Please help me considering me new to
the solr and linux.

-- 
Thanks and Regards,
Akeel ur Rehman Faridee


Re: Sending http post to solr indexing

2012-05-20 Thread Mansour Al Akeel
Sorry,
forgot to include the url and the error message:
private static String url = "http://localhost:8080/solr/update";;

The error I am getting on the server is:
SEVERE: org.apache.solr.common.SolrException: Unexpected character '{'
(code 123) in prolog; expected '<'
 at [row,col {unknown-source}]: [1,1]
at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:81)
at
org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:58)
at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1376)
at
org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:365)
at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:260)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.solr.servlets.SecurityFilter.doFilter(SecurityFilter.java:78)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected
character '{' (code 123) in prolog; expected '<'
 at [row,col {unknown-source}]: [1,1]
at
com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:648)
at
com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2047)
at
com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
at
org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:104)
at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:79)
... 24 more

May 21, 2012 12:32:13 AM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/solr path=/update params={} status=400 QTime=1



On Sun, May 20, 2012 at 8:34 PM, Mansour Al Akeel  wrote:

> I am trying to post some json objects to solr over http.  Here's my code:
>
> public void index(ProductData product) {
>
> HttpClient httpclient = new DefaultHttpClient();
> HttpPost httppost = new HttpPost(url);
> httppost.setHeader("Content-type", "application/json");
> httppost.getParams().setParameter("commit", "true");
>
> try {
> StringEntity entity;
> entity = new StringEntity(product.toString());
> httppost.setEntity(entity);
> HttpResponse response = httpclient.execute(httppost);
> System.out.println(product.toString());
> System.out.println(response.toString());
> } catch (UnsupportedEncodingException e) {
> e.printStackTrace();
> } catch (ParseException e) {
> e.printStackTrace();
> } catch (IOException e) {
> e.printStackTrace();
> }
> }
>
>
> I am getting error 400 bad request. The output showing JSON string (edited
> a bit),  and the response:
>
> { "timeStamp" : 1337560074593 , "title1" : "Sony Handycam HDR-XR260V 160
> GB Camcorder" , "price" : 116.5 , "condition" : "New" , "brand" : "Sony" ,
> "model" : "HDR-XR260V" , "mpn" : "HDR-XR260V"}
> HTTP/1.1 400 Bad Request [Server: Apache-Coyote/1.1, Content-Type:
> text/html;charset=utf-8, Content-Length: 1271, Date: Mon, 21 May 2012
> 00:27:56 GMT, Connection: close]
>
>
> Is there something I am missing or doing wrong ??
>
> Thank you.
>
>


Re: Sending http post to solr indexing

2012-05-20 Thread Mansour Al Akeel
I just updated my code. There no error , and getting back 200, but when I
perform a search in solr/admin, I get no results.
Here's my code:
@Override
public void index(ProductData product) {

HttpClient httpclient = new DefaultHttpClient();
HttpPost post = new HttpPost(url);
post.setHeader("Content-type", "application/json");
HttpParams params = new BasicHttpParams();
params.setParameter("commit", "true");
post.setParams(params);
String d = "[{ \"id\" : \"1234\",   \"name\" : \"My Product\" } ]";
try {
StringEntity entity = new StringEntity(d);
entity.setContentEncoding("UTF-8");
post.setEntity(entity);
HttpResponse response = httpclient.execute(post);
System.out.println(response);
System.out.print(post.getParams().getParameter("commit"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (ParseException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}

And this is output:
HTTP/1.1 200 OK [Server: Apache-Coyote/1.1, Content-Type:
application/xml;charset=UTF-8, Transfer-Encoding: chunked, Date: Mon, 21
May 2012 02:43:57 GMT]
true

On the server side, it's showing:
May 21, 2012 2:43:57 AM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/solr path=/update/json params={} status=0 QTime=0

I am not sure if this is because I am using HttpComponents the wrong way,
or I am doing something wrong with JSON string, or missing a parameter. As
far as I know, I need to add (commit=true) to the request param. But it
doesn't look like this is being received on the server.

Thank you.


On Sun, May 20, 2012 at 10:22 PM, Jack Krupansky wrote:

> See some examples here:
> http://wiki.apache.org/solr/**UpdateJSON<http://wiki.apache.org/solr/UpdateJSON>
>
> I think in your case you just need the JSON array squares brackets around
> the doument or list of documents.
>
> And also "update/json" in the URL.
>
> -- Jack Krupansky
>
> -Original Message- From: Mansour Al Akeel
> Sent: Sunday, May 20, 2012 8:35 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Sending http post to solr indexing
>
>
> Sorry,
> forgot to include the url and the error message:
>   private static String url = 
> "http://localhost:8080/solr/**update<http://localhost:8080/solr/update>
> ";
>
> The error I am getting on the server is:
> SEVERE: org.apache.solr.common.**SolrException: Unexpected character '{'
> (code 123) in prolog; expected '<'
> at [row,col {unknown-source}]: [1,1]
>   at org.apache.solr.handler.**XMLLoader.load(XMLLoader.java:**81)
>   at
> org.apache.solr.handler.**ContentStreamHandlerBase.**handleRequestBody(**
> ContentStreamHandlerBase.java:**58)
>   at
> org.apache.solr.handler.**RequestHandlerBase.**handleRequest(**
> RequestHandlerBase.java:129)
>   at org.apache.solr.core.SolrCore.**execute(SolrCore.java:1376)
>   at
> org.apache.solr.servlet.**SolrDispatchFilter.execute(**
> SolrDispatchFilter.java:365)
>   at
> org.apache.solr.servlet.**SolrDispatchFilter.doFilter(**
> SolrDispatchFilter.java:260)
>   at
> org.apache.catalina.core.**ApplicationFilterChain.**internalDoFilter(**
> ApplicationFilterChain.java:**243)
>   at
> org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
> ApplicationFilterChain.java:**210)
>   at
> org.apache.solr.servlets.**SecurityFilter.doFilter(**
> SecurityFilter.java:78)
>   at
> org.apache.catalina.core.**ApplicationFilterChain.**internalDoFilter(**
> ApplicationFilterChain.java:**243)
>   at
> org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
> ApplicationFilterChain.java:**210)
>   at
> org.apache.catalina.core.**StandardWrapperValve.invoke(**
> StandardWrapperValve.java:224)
>   at
> org.apache.catalina.core.**StandardContextValve.invoke(**
> StandardContextValve.java:169)
>   at
> org.apache.catalina.**authenticator.**AuthenticatorBase.invoke(**
> AuthenticatorBase.java:472)
>   at
> org.apache.catalina.core.**StandardHostValve.invoke(**
> StandardHostValve.java:168)
>   at
> org.apache.catalina.valves.**ErrorReportValve.invoke(**
> ErrorReportValve.java:98)
>   at
> org.apache.catalina.valves.**AccessLogValve.invoke(**
> AccessLogValve.java:928)
>   at
> org.apache.catalina.core.**StandardEngineValve.invoke(**
> StandardEngineValve.java:118)
>   at
> org.apache.catalina.connector.**CoyoteAdapter.service(**
> CoyoteA