Re: Non-prefix, hierarchical autocomplete? Would SOLR-1316 work? Solritas?

2010-06-20 Thread Erik Hatcher
Solritas is a way to view Solr responses in a more user friendly way,  
it isn't going to help with the underlying suggest mechanism, just the  
presentation of it.


Erik

On Jun 19, 2010, at 3:28 AM, Andy wrote:


Hi,

I've seen some posts on using SOLR-1316 or Solritas for  
autocomplete. Wondered what is the best solution for my use case:


1) I would like to have an "hierarchical" autocomplete. For example,  
I have a "Country" dropdown list and a "City" textbox. A user would  
select a country from the dropdown list, and then type out the City  
in the textbox. Based on which country he selected, I want to limit  
the autocomplete suggestions to cities that are relevant for the  
selected country.


This hierarchy could be multi-level. For example, there may be a  
"Neighborhood" textbox. The autocomplete suggestions for  
"Neighborhood" would be limited to neighborhoods that are relevant  
for the city entered by the user in the "City" textbox.


2) I want to have autocomplete suggestions that includes non-prefix  
matches. For example, if the user type "auto", the autocomplete  
suggestions should include terms such as "automata" and "build  
automation".


3) I'm doing autocomplete for tags. I would like to allow multi-word  
tags and use comma (",") as a separator for tags. So when the use  
hits the space bar, he is still typing out the same tag, but when he  
hits the comma key, he's starting a new tag.


Would SOLR-1316 or Solritas work for the above requirements? If they  
do how do I set it up? I can't really find much documentation on  
SOLR-1316 or Solritas in this area.


Thanks.







jdbc4.CommunicationsException

2010-06-20 Thread Blargy

Does anyone know a solution to this problem? I've already tried
autoReconnect=true and it doesn't appear to help. This happened 34 hours
into my full-import... ouch! 

org.apache.solr.handler.dataimport.DataImportHandlerException:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet
successfully received from the server was 21 milliseconds ago.  The last
packet sent successfully to the server was 124,896,004 milliseconds ago. is
longer than the server configured value of 'wait_timeout'. You should
consider either expiring and/or testing connection validity before use in
your application, increasing the server configured values for client
timeouts, or using the Connector/J connection property 'autoReconnect=true'
to avoid this problem.
at
org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow(DataImportHandlerException.java:64)
at
org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.hasnext(JdbcDataSource.java:339)
at
org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.access$700(JdbcDataSource.java:228)
at
org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator$1.hasNext(JdbcDataSource.java:262)
at
org.apache.solr.handler.dataimport.EntityProcessorBase.getNext(EntityProcessorBase.java:78)
at
org.apache.solr.handler.dataimport.SqlEntityProcessor.nextRow(SqlEntityProcessor.java:73)
at
org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(EntityProcessorWrapper.java:237)
at
org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:361)
at
org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.java:246)
at
org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:180)
at
org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:331)
at
org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:389)
at
org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.java:370)

-- 
View this message in context: 
http://lucene.472066.n3.nabble.com/jdbc4-CommunicationsException-tp909274p909274.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: jdbc4.CommunicationsException

2010-06-20 Thread Tor Henning Ueland
"The last packet sent successfully to the server was 124,896,004
milliseconds ago. is longer than the server configured value of
'wait_timeout'. You should consider either expiring and/or testing
connection validity before use in your application"

Sounds like MySQL.

Try to increase wait_timeout to a much higher value and see if its helps :)


/Tor

On Sun, Jun 20, 2010 at 4:41 PM, Blargy  wrote:
>
> Does anyone know a solution to this problem? I've already tried
> autoReconnect=true and it doesn't appear to help. This happened 34 hours
> into my full-import... ouch!
>
> org.apache.solr.handler.dataimport.DataImportHandlerException:
> com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet
> successfully received from the server was 21 milliseconds ago.  The last
> packet sent successfully to the server was 124,896,004 milliseconds ago. is
> longer than the server configured value of 'wait_timeout'. You should
> consider either expiring and/or testing connection validity before use in
> your application, increasing the server configured values for client
> timeouts, or using the Connector/J connection property 'autoReconnect=true'
> to avoid this problem.
>        at
> org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow(DataImportHandlerException.java:64)
>        at
> org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.hasnext(JdbcDataSource.java:339)
>        at
> org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.access$700(JdbcDataSource.java:228)
>        at
> org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator$1.hasNext(JdbcDataSource.java:262)
>        at
> org.apache.solr.handler.dataimport.EntityProcessorBase.getNext(EntityProcessorBase.java:78)
>        at
> org.apache.solr.handler.dataimport.SqlEntityProcessor.nextRow(SqlEntityProcessor.java:73)
>        at
> org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(EntityProcessorWrapper.java:237)
>        at
> org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:361)
>        at
> org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.java:246)
>        at
> org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:180)
>        at
> org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:331)
>        at
> org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:389)
>        at
> org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.java:370)
>
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/jdbc4-CommunicationsException-tp909274p909274.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Mvh
Tor Henning Ueland


IDH - "Total Documents Processed" is missing

2010-06-20 Thread Blargy

It seems that when importing via DIH the "Total Documents Processed" status
message does not appear when there are two entities for a given document. Is
this by design?

 
   
 

-- 
View this message in context: 
http://lucene.472066.n3.nabble.com/IDH-Total-Documents-Processed-is-missing-tp909325p909325.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Help patching Solr

2010-06-20 Thread Erick Erickson
I'm not going to be too much specific help for Windows here since I'm
running on a Mac, but...

All of this is done through ant, there's some help at the "how to
contribute" page, but nothing I see windows-specific:
http://wiki.apache.org/solr/HowToContribute

Which means you have to have your environment set up, with all the joy that
entails . You can start by just going to the solr directory and typing
the relevant commands and installing whatever's not found. At minimum you
need ant and the java sdk. You'll have to set up the environment variables
properly, including things like JAVA_HOME and PATH and, perhaps, ANT_HOME?
I'm sure there are others

You can see all the available top-level targets for ant by just typing
"ant", but a couple of useful ones are
"ant clean" for removing all compiled code
"ant test" for running all the unit tests
"ant dist" for creating war files.

Not too much help, but it's a start. It'd be great if you could list the
things you have to do and provide a how-to for the Wiki.

Good luck!
Erick

On Tue, Jun 15, 2010 at 3:04 PM, Moazzam Khan  wrote:

> Thanks. I finally patched it (I think). I got the source from SVN and
> applied the patch using a windows port. A caveat to those to want to
> do this on windows - open the file in wordpad and save it as a
> different file to replace unix line breaks with DOS line breaks.
> Otherwise, the patch program gives an error:
>
> Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354
>
> Now, that I have patched it (as far as I can tell) how do I build the
> sources :D (sorry I know it's a basic question but I have no idea how
> to do this)
>
> - Moazzam
>
> On Tue, Jun 15, 2010 at 1:14 PM, Nagelberg, Kallin
>  wrote:
> > I'm pretty sure you need to be running the patch against a checkout of
> the trunk sources, not a generated .war file. Once you've done that you can
> use the build scripts to make a new war.
> >
> > -Kallin Nagelberg
> >
> > -Original Message-
> > From: Moazzam Khan [mailto:moazz...@gmail.com]
> > Sent: Tuesday, June 15, 2010 1:53 PM
> > To: solr-user@lucene.apache.org
> > Subject: Help patching Solr
> >
> > Hey guys,
> >
> > Does anyone know how to patch stuff in Windows? I am trying to patch
> > Solr with patch 238 but it keeps erroring out with this message:
> >
> >
> >
> > C:\solr\example\webapps>patch solr.war ..\..\SOLR-236-trunk.patch
> > patching file solr.war
> > Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354
> >
> > This application has requested the Runtime to terminate it in an unusual
> way.
> > Please contact the application's support team for more information.
> >
> > Thanks in advance
> >
> > Moazzam
> >
>


SolrJ: Setting multiple parameters

2010-06-20 Thread Jay Hill
Working with SolrJ I'm doing a query using the StatsComponent, and the
stats.facet parameter. I'm not able to set multiple fields for the
"stats.facet" parameter using SolrJ. Here is the query I'm trying to create:

http://localhost:8983/solr/select/?q=*:*&stats=on&stats.field=fieldForStats&stats.facet=fieldA&stats.facet=fieldB&stats.facet=fieldC

This works perfectly, and I'm able to pull the "sum" value from all three
stats.facet fields, no problem.

Trying in SolrJ I have this:
  SolrQuery solrQuery = new SolrQuery();
solrQuery.setQuery("*:*");

solrQuery.setParam("stats", "on");
solrQuery.setParam("stats.field", "fieldForStats");
*solrQuery.setParam("stats.facet", "fieldA");
solrQuery.setParam("stats.facet", "fieldB");
solrQuery.setParam("stats.facet", "fieldC");*

But when I try to retrieve the "sum" values, it seems as if only the LAST
setParam I called on "stats.facet" is taking. So in this case I can get the
sum for fieldC, but not the other two:

//works
  Map statsInfoMap =
queryResponse.getFieldStatsInfo();
  FieldStatsInfo roomCountElement = statsInfoMap.get("fieldForStats");

  ArrayList fsi = (ArrayList) roomCountElement.getFacets().get("field*C*
");
  for (int i = 0; i < fsi.size(); i++) {

FieldStatsInfo m = (FieldStatsInfo) fsi.get(i);
System.out.println("--> " + m.getName() + "    " +
m.getSum());

  }

//doesn't work, get a null pointer as "fieldB" doesn't seem to have been
passed to "stats.facet"
  Map statsInfoMap =
queryResponse.getFieldStatsInfo();
  FieldStatsInfo roomCountElement = statsInfoMap.get("fieldForStats");

  ArrayList fsi = (ArrayList) roomCountElement.getFacets().get("field*B*
");
  for (int i = 0; i < fsi.size(); i++) {

FieldStatsInfo m = (FieldStatsInfo) fsi.get(i);
System.out.println("--> " + m.getName() + "    " +
m.getSum());

  }

Is there a way to set multiple values for "stats.facet" using the "setParm"
method?  I noticed that there is a "setGetFieldStatistics" method which can
be used to set the stats.field, but there don't seem to be any methods that
reach as deep as setting the stats.facet.

Thanks,
-Jay


Re: SolrJ: Setting multiple parameters

2010-06-20 Thread Chris Hostetter

: *solrQuery.setParam("stats.facet", "fieldA");
: solrQuery.setParam("stats.facet", "fieldB");
: solrQuery.setParam("stats.facet", "fieldC");*
: 
: But when I try to retrieve the "sum" values, it seems as if only the LAST
: setParam I called on "stats.facet" is taking. So in this case I can get the
: sum for fieldC, but not the other two:

It's a vararg method...
setParam(String name, String... values) 

...so use...

  solrQuery.setParam("stats.facet", "fieldA", "fieldB", "fieldC");

...or if your list of fields is being dynamicly generated...

  String[] fieldsForStatFaceting = getStatsFacetFields();
  solrQuery.setParam("stats.facet", fieldsForStatFaceting);



-Hoss



Re: SolrJ: Setting multiple parameters

2010-06-20 Thread Jan Høydahl / Cominvent
Or simply use add(), because setParam overrides existing hashMap key:

   solrQuery.setParam("stats.facet", "fieldA");
   solrQuery.add("stats.facet", "fieldB");
   solrQuery.add("stats.facet", "fieldC");

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com
Training in Europe - www.solrtraining.com

On 20. juni 2010, at 21.17, Chris Hostetter wrote:

> 
> : *solrQuery.setParam("stats.facet", "fieldA");
> : solrQuery.setParam("stats.facet", "fieldB");
> : solrQuery.setParam("stats.facet", "fieldC");*
> : 
> : But when I try to retrieve the "sum" values, it seems as if only the LAST
> : setParam I called on "stats.facet" is taking. So in this case I can get the
> : sum for fieldC, but not the other two:
> 
> It's a vararg method...
>   setParam(String name, String... values) 
> 
> ...so use...
> 
>  solrQuery.setParam("stats.facet", "fieldA", "fieldB", "fieldC");
> 
> ...or if your list of fields is being dynamicly generated...
> 
>  String[] fieldsForStatFaceting = getStatsFacetFields();
>  solrQuery.setParam("stats.facet", fieldsForStatFaceting);
> 
> 
> 
> -Hoss
> 



Re: Indexing HTML files in SOLR

2010-06-20 Thread seesiddharth

Thank you so much for your help... I will try it...
-- 
View this message in context: 
http://lucene.472066.n3.nabble.com/Indexing-HTML-files-in-SOLR-tp896530p910555.html
Sent from the Solr - User mailing list archive at Nabble.com.