Re: import data into solr from velocity (aka Solritas)

2014-10-18 Thread Erik Hatcher
Could you elaborate more on what you're trying to do?   You've defined a new 
request handler?   You can use any template you want with the Velocity writer - 
v.template=template_name

As for DIH - it can do a lot, database, XML, email, another Solr, etc. 

What kind of "import" are you trying to accomplish?

   Erik


> On Oct 18, 2014, at 01:36, LongY  wrote:
> 
> hello everyone, 
> 
> I did lots of search, and did not find a proper way to solve this problem,
> and 
> it brings me to here ask for help. 
> 
> I am trying to import data from velocity into solr. I defined a new link
> which 
> is localhost:8983/solr/collection1/browse/importdata. This webpage is used
> to 
> collect the data imported. However, it seems the velocity is only able to
> define 
> only one main template, in other words, I am not able to add one more
> webpage 
> in this velocity UI. 
> 
> I also checked DIH (data import handler), it seems it only works with
> relational databases or XML files. 
> 
> My question is: how can I import data from velocity UI. 
> 
> Any input is welcome.
> 
> 
> 
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/import-data-into-solr-from-velocity-aka-Solritas-tp4164751.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Re: import data into solr from velocity (aka Solritas)

2014-10-18 Thread LongY
Thanks a lot. Eric.

I still used the same /browse request handler in the example.

My goal is to create a webform UI to collect user input to be further
indexed.
My thoughts is adding a new webpage to the existing user interface, the link
is
localhost:8983/solr/collection1/browse/. I added a new link which is
localhost:8983/solr/collection1/browse/importdata.

The problem is: how to add a new webform in the existing velocity response
writer.
Velocity seems allow only one html layout file.

Regarding DIH, it seems does not have this functionality. It is not able to
collect the user input
from a webpage, like a webform.





--
View this message in context: 
http://lucene.472066.n3.nabble.com/import-data-into-solr-from-velocity-aka-Solritas-tp4164751p4164784.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: import data into solr from velocity (aka Solritas)

2014-10-18 Thread Shawn Heisey
On 10/18/2014 8:15 AM, LongY wrote:
> I still used the same /browse request handler in the example.
> 
> My goal is to create a webform UI to collect user input to be further
> indexed.
> My thoughts is adding a new webpage to the existing user interface, the link
> is
> localhost:8983/solr/collection1/browse/. I added a new link which is
> localhost:8983/solr/collection1/browse/importdata.
> 
> The problem is: how to add a new webform in the existing velocity response
> writer.
> Velocity seems allow only one html layout file.

I have no wish to disparage whoever built the /browse handler and/or
whoever maintains it, even though it might seem like it with what I'm
going to say below.  I've only glanced at the code, but it does not look
like a trivial work.  It serves as an excellent example for Solr's
capabilities, so it's really nice to have.

If the code you are developing is intended to face the public, you do
not want to use the /browse handler, and you do not want to utilize a
javascript solr client.

The reason is simple:  These things require that the end user has direct
access to your Solr server.

If someone has direct access to your Solr server, it's wide open to
them.  They can change the index, delete the index, send crafted denial
of service queries, etc.  It's possible to put Solr behind an
intelligent proxy that can detect these attempts and deny them, but
configuring such a proxy is not an easy task.

There's a special caveat for what you're trying to do:  It would require
leaving the indexing handler open, even through a proxy, so you'd have
no protection against users changing your index to include whatever they
want.

If the audience for what you are writing is completely trustworthy and
internal, and the web server will not face the Internet, then you can
set it up any way you like without worry, use any technology you want.

Thanks,
Shawn



Re: import data into solr from velocity (aka Solritas)

2014-10-18 Thread LongY
Thanks for pointing this out.

The web server I developed is only for internal use, and users are
trustworthy.

Yes, I agree with you. Velocity/Solaritas is never intended to be a
user-facing app.
It need a middleware layer if user is public.









--
View this message in context: 
http://lucene.472066.n3.nabble.com/import-data-into-solr-from-velocity-aka-Solritas-tp4164751p4164787.html
Sent from the Solr - User mailing list archive at Nabble.com.


How to properly use Levenstein distance with ~ in Java

2014-10-18 Thread Aleksander Sadecki
Hi,

I have got a SOLR instance on my local machine with samples of data. When I
run in myhost:8083/solr/#/mycore/query a query: title:taverna it gives me 4
results. When I make a mistake, for instance: title:taveranx it gives me 0
results but with '~' it finds all of the 4 samples which have been found
before.

I am trying to add Levenstein distance in my Java code.

I have got a piece of code:

import org.apache.solr.client.solrj.SolrServer;
// ...
private SolrServer solrServer // ...
QueryResponse originalResponse = solrServer.query(solrQuery);

here you can find how my variable solrQuery looks
like:http://oi59.tinypic.com/izmiwk.jpg

and no documents have been found.

I found queries which have been executed in SOLR and it looks like this:

Oct 18, 2014 7:02:11 PM org.apache.solr.core.SolrCore execute

INFO: [aos] webapp=/solr path=/select
params={spellcheck=true&spellcheck.collateExtendedResults=true&tie=0.1&spellcheck.maxCollations=4&spellcheck.maxCollationTries=1000&qf=tags^11.0+title^10.0+...&q.alt=*:*&wt=javabin&spellcheck.collate=true&version=2&rows=10&defType=dismax&fl=*&bq=type:some_field^100&start=0&q=taveranx~&bf=recip(ms(NOW,publication_date),1.15e-08,3650,3650)&spellcheck.count=20&qt=dismax&fq=-status:C&fq=-(-startDate:[NOW+TO+*]+AND+type:some_field)&fq=-type:listing}
hits=0 status=0 QTime=22

Oct 18, 2014 7:02:11 PM org.apache.solr.core.SolrCore execute

INFO: [aos] webapp=/solr path=/select
params={spellcheck=true&facet=true&spellcheck.collateExtendedResults=true&tie=0.1&spellcheck.maxCollations=4&spellcheck.maxCollationTries=1000&qf=tags^11.0+...&q.alt=*:*&wt=javabin&spellcheck.collate=true&version=2&rows=0&defType=dismax&fl=*&bq=type:some_field^100&start=0&q=taveranx~&bf=recip(ms(NOW,publication_date),1.15e-08,3650,3650)&facet.field=type&spellcheck.count=20&qt=dismax&fq=-status:C&fq=-(-startDate:[NOW+TO+*]+AND+type:some_field)}
hits=0 status=0 QTime=29

Can someone tell me where could be a mistake?

Thank you in advance
Alex


Re: FW: Complex boost statement

2014-10-18 Thread William Bell
Wouldn't it be?

 if(and(exists(query({!v="BUS_CITY:regina"})),not(query({!v="BUS_IS_
TOLL_FREE:true"})),500,1)

On Fri, Oct 17, 2014 at 2:07 PM, Corey Gerhardt <
corey.gerha...@directwest.com> wrote:

> Apparently I need to a long holiday so that I can interpret the
> documentation correctly.
>
>  if(and(exists(query({!v="BUS_CITY:regina"})),not(BUS_IS_TOLL_FREE)),500,1)
>
> -Original Message-
> From: Corey Gerhardt [mailto:corey.gerha...@directwest.com]
> Sent: October-16-14 4:11 PM
> To: Solr User List
> Subject: Complex boost statement
>
> Edismax, solrnet
>
> I'm thinking that solrnet is going to be my problem due to I can only sent
> one "boost"  parameter.
>
> Is it possible to have a boost value:
>
> if(exists(query({!v="BUS_CITY:regina"}))&&(BUS_IS_NEARBY),20,1)
>
> Thanks,
>
> Corey
>
>


-- 
Bill Bell
billnb...@gmail.com
cell 720-256-8076


issue in launching SolrCloud windows/cygwin

2014-10-18 Thread Anurag Sharma
Here is the issue am facing issue in using the 'solr' script on Windows
with cygwin terminal:

$ bin/solr -e cloud
bin/solr: line 16: $'\r': command not found
bin/solr: line 17: $'\r': command not found
bin/solr: line 46: $'\r': command not found
which: no lsof in
(/usr/local/bin:/usr/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program
Files/TortoiseSVN/bin:/cygdrive/c/Program
Files/Java/jdk1.7.0_51/bin:/cygdrive/c/Program
Files/apache-ant-1.9.3/bin:/cygdrive/c/Program Files
(x86)/Python-27:/cygdrive/c/Program Files (x86)/Python-27/Scripts)
bin/solr: line 52: $'\r': command not found
bin/solr: line 87: syntax error near unexpected token `"$HOME/.solr.in.sh"'
'in/solr: line 87: `   "$HOME/.solr.in.sh" \


further
$ bin/solr start -cloud -d node1 -p 8983
bin/solr: line 16: $'\r': command not found
bin/solr: line 17: $'\r': command not found
bin/solr: line 46: $'\r': command not found
which: no lsof in
(/usr/local/bin:/usr/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program
Files/TortoiseSVN/bin:/cygdrive/c/Program
Files/Java/jdk1.7.0_51/bin:/cygdrive/c/Program
Files/apache-ant-1.9.3/bin:/cygdrive/c/Program Files
(x86)/Python-27:/cygdrive/c/Program Files (x86)/Python-27/Scripts)
bin/solr: line 52: $'\r': command not found
bin/solr: line 87: syntax error near unexpected token `"$HOME/.solr.in.sh"'
'in/solr: line 87: `   "$HOME/.solr.in.sh" \

Is there any other way I can run the SolrCloud using "java -jar start.jar"
options?