Solr custom plugins: is it possible to have them persistent?

2011-08-29 Thread samuele.mattiuzzo
I've posted a similar question few days ago, but our needs have gone a bit further. I need to develop two plugins which need to be persistent throu the whole indexing and updating process The first one need to open a connection to a mysql instance (and query that connection during every document

Re: Solr custom plugins: is it possible to have them persistent?

2011-08-29 Thread samuele.mattiuzzo
it's how i'm doing it now... but i'm not sure i'm placing the objects into the right place significant part of my code here : http://pastie.org/2448984 (i've omitted the methods implementations since are pretty long) inside the method setLocation, i create the connection to mysql database insid

Re: Solr custom plugins: is it possible to have them persistent?

2011-08-30 Thread samuele.mattiuzzo
my problem is i still don't understand where i have to put that singleton (or how i can load it into solr) i have my singleton class Connector for mysql, with all its methods defined. Now what? This is the point i'm missing :( -- View this message in context: http://lucene.472066.n3.nabble.com/S

Re: Solr custom plugins: is it possible to have them persistent?

2011-08-30 Thread samuele.mattiuzzo
ok so my two singleton classes are MysqlConnector and JFJPConnector basically: 1 - jar them 2 - cp them to /custom/path/within/solr/ 3 - modify solrconfig.xml with /custom/path/within/solr/ my two jars are then automatically loaded? nice! in my CustomUpdateProcessor class i can call MysqlConnec

Re: Solr custom plugins: is it possible to have them persistent?

2011-08-30 Thread samuele.mattiuzzo
i think it's better for me to keep it under some solr installation path, i don't want to loose files :) ok, i'm going to try this out :) i already got into the "package" issue (my.package.whatever) this one i know how to handle! thanks for all the help, i'll post again to tell you "It Works!" (bu

Re: Solr custom plugins: is it possible to have them persistent?

2011-08-30 Thread samuele.mattiuzzo
i thinki i have to drop the singleton class solution, since my boss wants to add 2 other different solr installation and i need to reuse the plugins i'm working on... so i'll have to use a connectionpool or i will create hangs when the 3 cores update their indexes at the same time :( -- View this

Re: Solr custom plugins: is it possible to have them persistent?

2011-08-31 Thread samuele.mattiuzzo
Eh eh you're right! This is what happens when you try to learn too much things in the same moment! Btw, i found this http://webdevelopersjournal.com/columns/connection_pool.html which is perfect, i can use the provided code as my singleton instance, now i just have to figure out how i can detect t

Re: Solr custom plugins: is it possible to have them persistent?

2011-08-31 Thread samuele.mattiuzzo
SEVERE: org.apache.solr.common.SolrException: Error Instantiating UpdateRequestProcessorFactory, ToTheGoCustom is not a org.apache.solr.update.processor.UpdateRequestProcessorFactory i'm getting this error, but i don't know how to fix it this is solrconfig.xml: ...

Re: Solr custom plugins: is it possible to have them persistent?

2011-09-01 Thread samuele.mattiuzzo
yay i did it! i wasn't that far away from the correct implementation, it just was a bit tricky to understand how to... now i've got a problem with my singleton class: i have DBConnectionManager.jar put inside a folder ( from solrconfig.xml) but at indextime i have this error: Sep 1, 2011 10:21:2

Re: Solr custom plugins: is it possible to have them persistent?

2011-09-01 Thread samuele.mattiuzzo
ok solved it by changing () to ty guys for all yor help, now off to debug some java errors hehe thanks again, for real! -- View this message in context: http://lucene.472066.n3.nabble.com/Solr-custom-plugins-is-it-possible-to-have-them-persistent-tp3292781p3300629.html Sent from the Solr - U

Re: Issue with Solr and copyFields

2011-09-01 Thread samuele.mattiuzzo
you need to define the "search" field as MultiValued since you're copying into it multiple sources http://wiki.apache.org/solr/FAQ#How_do_I_use_copyField_with_wildcards.3F -- View this message in context: http://lucene.472066.n3.nabble.com/Issue-with-Solr-and-copyFields-tp3300763p3300794.html

Re: Solr custom plugins: is it possible to have them persistent?

2011-09-01 Thread samuele.mattiuzzo
Thanks, but this was not the point of the topic :) I'm way more further than this :) Please, avoid random replies :) -- View this message in context: http://lucene.472066.n3.nabble.com/Solr-custom-plugins-is-it-possible-to-have-them-persistent-tp3292781p3301057.html Sent from the Solr - User mail

Solr indexing plugin: skip single faulty document?

2011-10-17 Thread samuele.mattiuzzo
Hi all, as far as i know, when solr finds a faulty document (inside an xml containing let say 1000 docs) it skips the whole file and the indexing process exits with exception (am i correct?) I'm using a custom indexing plugin, and i can trap the exception. Instead of using "default" values if that

Re: Solr indexing plugin: skip single faulty document?

2011-10-24 Thread samuele.mattiuzzo
Thanks Erik! I'll be reading that issue, it's pretty much everything i need! -- View this message in context: http://lucene.472066.n3.nabble.com/Solr-indexing-plugin-skip-single-faulty-document-tp3427646p3447400.html Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr indexing plugin: skip single faulty document?

2011-10-24 Thread samuele.mattiuzzo
Ok i'll surely check out what i can! -- View this message in context: http://lucene.472066.n3.nabble.com/Solr-indexing-plugin-skip-single-faulty-document-tp3427646p3447537.html Sent from the Solr - User mailing list archive at Nabble.com.

Regex replacement not working!

2011-06-29 Thread samuele.mattiuzzo
Hi, i have this bunch of lines in my schema.xml that should do a replacement but it doesn't work! I need it to extract only the numbers from some other string. The strings can be anything: only letters (so it should replace it with an empty string), le

Re: Regex replacement not working!

2011-06-29 Thread samuele.mattiuzzo
this is the "final" version of my schema part, but what i get is this: 1.0

Re: Regex replacement not working!

2011-06-29 Thread samuele.mattiuzzo
Index Analyzer org.apache.solr.analysis.KeywordTokenizerFactory {luceneMatchVersion=LUCENE_31} position1 term text £22000 - £25000 per annum + benefits startOffset 0 endOffset 36 org.apache.solr.analysis.PatternReplaceFilterFactory {replacement=$2, pattern=[^\d]?([0-9]+[k,

Re: Regex replacement not working!

2011-06-29 Thread samuele.mattiuzzo
i have the string "You may earn 25k dollars per week" stored in the field "salary" i'm using 2 copyfields "salary_min" and "salary_max" with source in "salary" with those 2 datatypes salary is "text" salary_min is "salary_min_text" salary_max is "salary_max_text" so, i was expecting this: solr

Re: Regex replacement not working!

2011-06-29 Thread samuele.mattiuzzo
ok, but i'm not applying the filtering on the copyfields. this is how my schema looks: and the two datatypes defined before. that's why i tought i could first use "copyField" to copy the value then index them with my two datatypes filtering... -- View this message in context: http://l

Re: Regex replacement not working!

2011-06-29 Thread samuele.mattiuzzo
my goal is/was storing the value into the field, and i get i have to create my Update handler. i was trying to use query with salary_min:[100 TO 200] and it's actually working... since i just need it to search, i'll stay with this solution is the [100 TO 200] a performance killer? i remember read

Re: Regex replacement not working!

2011-06-29 Thread samuele.mattiuzzo
ok, last question on the UpdateProcessor: can you please give me the steps to implement my own? i mean, i can push my custom processor in solr's code, and then what? i don't understand how i have to change the solrconf.xml and how can i bind that to the updater i just wrotea and also i don't unders

Re: Regex replacement not working!

2011-06-29 Thread samuele.mattiuzzo
too bad it is still in todo, that's why i was asking some for some tips on writing, compiling, registration, calling... -- View this message in context: http://lucene.472066.n3.nabble.com/Regex-replacement-not-working-tp3120748p3121856.html Sent from the Solr - User mailing list archive at Nabbl

Re: any detailed tutorials on plugin development?

2011-07-20 Thread samuele.mattiuzzo
actually i'm rewriting http://wiki.apache.org/solr/UpdateRequestProcessor this wiki page with a more detailed how-to, it will be ready and online after i get back from work! -- View this message in context: http://lucene.472066.n3.nabble.com/any-detailed-tutorials-on-plugin-development-tp3177821p

Solr indexing process: keep a persistent Mysql connection throu all the indexing process

2011-08-23 Thread samuele.mattiuzzo
I wrote my custom update handler for my solr installation, using jdbc to query a mysql database. Everything works fine: the updater queries the db, gets the data i need and update it in my documents! Fantastic! Only issue is i have to open and close a mysql connection for every document i read. Si

Re: Solr indexing process: keep a persistent Mysql connection throu all the indexing process

2011-08-23 Thread samuele.mattiuzzo
those documents are unrelated to the database. the db i have is just storing countries - region - cities, and it's used to do a refinement on a specific solr field example: solrField "thetext" with content "Mary comes from London" updateHandler polls the database for europe - great britain - lon

Re: Solr indexing process: keep a persistent Mysql connection throu all the indexing process

2011-08-23 Thread samuele.mattiuzzo
those documents are unrelated to the database. the db i have is just storing countries - region - cities, and it's used to do a refinement on a specific solr field example: solrField "thetext" with content "Mary comes from London" updateHandler polls the database for europe - great britain - lon

Re: Solr indexing process: keep a persistent Mysql connection throu all the indexing process

2011-08-25 Thread samuele.mattiuzzo
since i'm barely new to solr, can you please give some guidelines or provide an example i can look at for starters? i already tought about a singleton implementation, but i'm not sure where i have to put it and how should i start coding it -- View this message in context: http://lucene.472066.n3