Re: How to add TrieIntField to a SolrInputDocument?

2011-07-14 Thread Gabriele Kahlout
this works:

doc.remove(wc);
SolrInputField wcField = new SolrInputField(wc);
wcField.setValue(150, 1.0f);
doc.put(wc,wcField);

On Wed, Jul 13, 2011 at 4:19 PM, Gabriele Kahlout
gabri...@mysimpatico.comwrote:

 SolrInputDocument doc = new SolrInputDocument();
 doc.setField(id, 0);
 doc.setField(url, getURL(0));
 doc.setField(content, blah blah blah);
 *doc.setField(wc, 150); //wc is of solr.TrieIntField field type in
 schema.xml*
 assertU(adoc(doc));
 assertU(commit());
 assertNumFound(1);

 The above test fails until I change the following in schema.xml:
  - fieldType name=int class=solr.*TrieIntField* omitNorms=true/
  + fieldType name=int class=solr.*IntField* omitNorms=true/


 On Sun, Jul 10, 2011 at 10:36 PM, Gabriele Kahlout 
 gabri...@mysimpatico.com wrote:


 This was my problem:
 fieldType name=int class=solr.TrieIntField omitNorms=true/

 I had taken my queu from Nutch's schema:
 fieldType name=long class=solr.LongField omitNorms=true/



 On Sat, Jul 9, 2011 at 4:55 PM, Yonik Seeley 
 yo...@lucidimagination.comwrote:

 Something is wrong with your indexing.
 Is wc an indexed field?  If not, change it so it is, then re-index your
 data.

 If so, I'd recommend starting with the example data and filter for
 something like popularity:[6 TO 10] to convince yourself it works,
 then figuring out what you did differently in your schema/data.

 -Yonik
 http://www.lucidimagination.com

 On Sat, Jul 9, 2011 at 10:50 AM, Gabriele Kahlout
 gabri...@mysimpatico.com wrote:
  http://localhost:8080/solr/select?indent=onversion=2.2q=*%3A**
  fq=wc%3A%5B255+TO+257%5D*
  start=0rows=10fl=*%2Cscoreqt=wt=xmlexplainOther=hl.fl=
 
  The toString of the request:
 
 {explainOther=fl=*,scoreindent=onstart=0q=*:*hl.fl=qt=wt=xmlfq=wc:[255+TO+257]rows=1version=2.2}
 
  Even when the FilterQuery is constructed in Java it doesn't work (i get
  results that ignore the filter query completely).
 
 
  On Sat, Jul 9, 2011 at 3:40 PM, Ahmet Arslan iori...@yahoo.com
 wrote:
 
   I don't get it to work!
  
   If I specify no fq I get the first result with int
   name=wc256/int
  
   With wc:[255 TO 257] (fq=wc%3A%5B255+TO+257%5D) nothing
   comes out.
 
  If you give us the Full URL you are using, it can be helpful.
 
  Correct syntax is fq=wc:[255 TO 257]
 
  You can use more that fq in a request.
 
 
 
 
  --
  Regards,
  K. Gabriele
 
  --- unchanged since 20/9/10 ---
  P.S. If the subject contains [LON] or the addressee acknowledges the
  receipt within 48 hours then I don't resend the email.
  subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧
 time(x)
   Now + 48h) ⇒ ¬resend(I, this).
 
  If an email is sent by a sender that is not a trusted contact or the
 email
  does not contain a valid code then the email is not received. A valid
 code
  starts with a hyphen and ends with X.
  ∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y
 ∈
  L(-[a-z]+[0-9]X)).
 




 --
 Regards,
 K. Gabriele

 --- unchanged since 20/9/10 ---
 P.S. If the subject contains [LON] or the addressee acknowledges the
 receipt within 48 hours then I don't resend the email.
 subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧
 time(x)  Now + 48h) ⇒ ¬resend(I, this).

 If an email is sent by a sender that is not a trusted contact or the email
 does not contain a valid code then the email is not received. A valid code
 starts with a hyphen and ends with X.
 ∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
 L(-[a-z]+[0-9]X)).




 --
 Regards,
 K. Gabriele

 --- unchanged since 20/9/10 ---
 P.S. If the subject contains [LON] or the addressee acknowledges the
 receipt within 48 hours then I don't resend the email.
 subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧
 time(x)  Now + 48h) ⇒ ¬resend(I, this).

 If an email is sent by a sender that is not a trusted contact or the email
 does not contain a valid code then the email is not received. A valid code
 starts with a hyphen and ends with X.
 ∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
 L(-[a-z]+[0-9]X)).




-- 
Regards,
K. Gabriele

--- unchanged since 20/9/10 ---
P.S. If the subject contains [LON] or the addressee acknowledges the
receipt within 48 hours then I don't resend the email.
subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧ time(x)
 Now + 48h) ⇒ ¬resend(I, this).

If an email is sent by a sender that is not a trusted contact or the email
does not contain a valid code then the email is not received. A valid code
starts with a hyphen and ends with X.
∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
L(-[a-z]+[0-9]X)).


Is it possible to extract all the tokens from solr?

2011-07-14 Thread Pankaj
 Hello Everyone,

How to extract all the tokens from solr, not from one document but from all
the documents indexed in solr?

- Thanks


Re: ' invisible ' words

2011-07-14 Thread Jayendra Patil
Strange .. the only other difference that I see is the different
configurations for the word delimiter filter, with the catenatewords
and catenatenumbers @ index and query but it should not impact normal
word searches.

As others suggested, you may just want to use the same chain for both
Index and query to start with and start with plain tokenizer and then
add up filters one by one.

Regards,
Jayendra

On Wed, Jul 13, 2011 at 11:29 PM, deniz denizdurmu...@gmail.com wrote:
 Hi Jayendra,

 I have changed the order and also removed the line related with synonyms...
 but the result is still the same... somehow some words are just invisible
 during my searches...

 -
 Zeki ama calismiyor... Calissa yapar...
 --
 View this message in context: 
 http://lucene.472066.n3.nabble.com/invisible-words-tp3158060p3168039.html
 Sent from the Solr - User mailing list archive at Nabble.com.



Re: Preserve XML hierarchy

2011-07-14 Thread Lucas Miguez
Hi,

yes, I was asking about it, is it possible to index an XML file?

Is it possible to know which node of the XML the search result comes from?

So I have 2 XML files, the original and the summary. I want to index
the summary. So, that is an example of the summary XML:

Objetives
  Activity xpath=2_3
TitlePA. /TitleP
TextPRequisitos generales mínimos exigibles a las
explotaciones para las que se soliciten
las ayudas./TextP
Part
  TitlePart7. Además, la actividad de la explotación deberá
garantizar:
/TitlePart
  gSubPart
SubPart
  TextSubParta) Gestión de los medios de producción./TextSubPart
/SubPart
SubPart
  TextSubPartb) Conservación de elementos propios de la
zona y en consonancia con el medio./TextSubPart
/SubPart
  /gSubPart
/Part
  /Activity
/Objectives

That is an summary of my original XML file. So, the xpath atribute in
Activity Element shows me the way to retrieve the information in the
original file (2_3 : 2 is the second element in PartV, and 3 is the
third Part inside the second PartV).
So, I need to index the fields (TitleP, TextP, TitlePart, TextPart,
TextSubPart. This fields can occur zero or more times), and I want to
know the xpath to the original file for each field, because I need to
show to the user the hierarchy of the results. Following the XML
example: Imagine that the user search the word zona, then I have to
show the TitleP, the TextP, the TitlePart, the TextPart and all the
TextSubPart that are childs of gSubPart.

Is there any example similar to my issue?

Thanks!



2011/7/13 Gora Mohanty g...@mimirtech.com:
 On Wed, Jul 13, 2011 at 10:30 PM, Lucas Miguez lucas.mig...@gmail.com wrote:
 Hi,

 is it possible to do that in Apache Solr? If i make a search, how I
 know from where it comes the result?
 [...]

 Your question is not very clear, and I happen unfortunately to be
 out of crystal balls and Tarot cards.

 Is it possible to do what? Make a search on what, and what sort
 of results do you you expect from said search?

 Peering into the misty depths of my non-existent crystal ball,
 if you are asking is it possible to index an XML file, search it,
 and figure out which node of the XML the search result comes
 from, yes that is possible; though details, and better advice
 would require more input from your side. Roughly speaking,
 each node can go into a separate Solr field, and full-text
 search on all relevant fields is also possible. Joking aside, please
 do provide more details.

 Regards,
 Gora



Lockfactory indicated by ../solr/admin/cores different from the setting in solrconfig.xml

2011-07-14 Thread nipunb
hey
We have set locktype to simple in solrconfig.xml using:
lockTypesimple/lockType. However on the page
localhost:8983/solr/admin/cores shows:
str name=directory
org.apache.lucene.store.MMapDirectory:org.apache.lucene.store.MMapDirectory/solr-cores/core0/data/index
lockFactory=*org.apache.lucene.store.NativeFSLockFactory*@3415ddf5
/str
I can see a write.lock file in the index directory. But shouldn't the page
solr/admin/cores also be showing the the lockFactory to be
org.apache.lucene.store.SimpleFSLockFactory.SimpleFSLockFactory

thanks
nipun 

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Lockfactory-indicated-by-solr-admin-cores-different-from-the-setting-in-solrconfig-xml-tp3168427p3168427.html
Sent from the Solr - User mailing list archive at Nabble.com.


Why cannot I open a read-only IndexReader from TestHarness.getIndexDir() ?

2011-07-14 Thread Gabriele Kahlout
 IndexReader getReader() throws CorruptIndexException, IOException {
return IndexReader.open(FSDirectory.open(new
File(h.getCore().getIndexDir())), true);
}

*org.apache.lucene.index.IndexNotFoundException: no segments* file found in
org.apache.lucene.store.NIOFSDirectory@/private/var/folders/54/54wUdohaH8eR-mvbJL0l2k+++TI/-Tmp-/solrtest-SolrTestCaseJ4-1310631397578/index
lockFactory=org.apache.lucene.store.NativeFSLockFactory@62d337d3: files: []*
at
org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:694)
at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:75)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:428)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:288)
at com.mysimpatico.me.indexplugins.SolrTest.getReader(SolrTest.java:43)

I'm calling it right after a assertU(commit()) and assertQ(req(*:*),
getNumFoundXPath(1)) which asserts a document has been indexed.

-- 
Regards,
K. Gabriele

--- unchanged since 20/9/10 ---
P.S. If the subject contains [LON] or the addressee acknowledges the
receipt within 48 hours then I don't resend the email.
subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧ time(x)
 Now + 48h) ⇒ ¬resend(I, this).

If an email is sent by a sender that is not a trusted contact or the email
does not contain a valid code then the email is not received. A valid code
starts with a hyphen and ends with X.
∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
L(-[a-z]+[0-9]X)).


SolrJ Collapsable Query Fails

2011-07-14 Thread Kurt Sultana
I am currently trying to run a collapsable query using SolrJ using SolR 3.3.
The problem is that when I run the query through the web interface, with
this url:

http://localhost:8080/solr/select/?q=attr_content%3Alynxsort=attr_location+descgroup=truegroup.field=attr_directory

I am able to see the XML which is returned. The problem though, is that when
I try to run the same query through SolrJ, using this code:

SolrQuery queryString = new SolrQuery();

for (String param : query.keySet())

{
if (param.equals(fq))

{
queryString.addFilterQuery(query.get(param));

}
else
{
queryString.setParam(param, query.get(param));

}
}

System.out.println(queryString.toString());

QueryResponse response = server.query(queryString);
//Exception takes place at this line

SolrDocumentList docList = response.getResults();

Which constructs a URL like so:

q=attr_content%3Alynxsort=attr_location+descgroup=truegroup.field=attr_directory

This throws an exception:

Caused by: org.apache.solr.common.SolrException: parsing error at
org.apache.solr.client.solrj.impl.XMLResponseParser.processResponse(XMLResponseParser.java:145)
at
org.apache.solr.client.solrj.impl.XMLResponseParser.processResponse(XMLResponseParser.java:106)
at
org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:477)
at
org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:244)
at
org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:89)
... 3 more Caused by: javax.xml.stream.XMLStreamException: ParseError at
[row,col]:[3,30088] Message: error reading value:LST at
org.apache.solr.client.solrj.impl.XMLResponseParser.readArray(XMLResponseParser.java:324)
at
org.apache.solr.client.solrj.impl.XMLResponseParser.readNamedList(XMLResponseParser.java:245)
at
org.apache.solr.client.solrj.impl.XMLResponseParser.readNamedList(XMLResponseParser.java:244)
at
org.apache.solr.client.solrj.impl.XMLResponseParser.readNamedList(XMLResponseParser.java:244)
at
org.apache.solr.client.solrj.impl.XMLResponseParser.processResponse(XMLResponseParser.java:130)

I have tried it with both Jetty and Tomcat, the error is the same for both.
I have managed to get other queries to run (with both servers), so I presume
that the problem lies with this particular type of query.

Any insight on this problem will be highly appreciated,

Thanks :)


Re: Is it possible to extract all the tokens from solr?

2011-07-14 Thread pravesh
You can use lucene for doing this. It provides TermEnum API to enumerate all
terms of field(s).
 SOLR-1.4.+ also provides a special request handler for this purpose. Check
it if that helps

Thanx
Pravesh

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Is-it-possible-to-extract-all-the-tokens-from-solr-tp3168362p3168589.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: ' invisible ' words

2011-07-14 Thread deniz
well i know it is totally weird... i have tried many things , including the
ones in this forum, but the result is the same... somehow some words are
just invisible... 



-
Zeki ama calismiyor... Calissa yapar...
--
View this message in context: 
http://lucene.472066.n3.nabble.com/invisible-words-tp3158060p3168598.html
Sent from the Solr - User mailing list archive at Nabble.com.


how to do ExactMatch for PhraseQuery

2011-07-14 Thread Mohammad Shariq
I need exact match On PhraseQuery.
when I search for the phrase call it spring   I get the result for :
1) It's spring
2) The spring

but my requirement is ExactMatch for PhraseQuery.
my search field is text.
Along with PhraseQuery I am doing RegularQuery too.
how to tune the solr to do Exactmatch for PhraseQuery without affecting
RegularQuery.

below is text field of schema.xml.

fieldType name=text class=solr.TextField positionIncrementGap=100
analyzer type=index
tokenizer class=solr.WhitespaceTokenizerFactory/
filter class=solr.CommonGramsFilterFactory words=stopwords.txt
maxShingleSize=3 ignoreCase=true/
filter class=solr.WordDelimiterFilterFactory generateWordParts=1
generateNumberParts=1 catenateWords=1 catenateNumbers=1
catenateAll=0 splitOnCaseChange=1/
filter class=solr.LowerCaseFilterFactory/
filter class=solr.SnowballPorterFilterFactory language=English
protected=protwords.txt/

/analyzeranalyzer type=query
tokenizer class=solr.WhitespaceTokenizerFactory/
filter class=solr.CommonGramsFilterFactory words=stopwords.txt
maxShingleSize=3 ignoreCase=true/
filter class=solr.WordDelimiterFilterFactory generateWordParts=1
generateNumberParts=1 catenateWords=0 catenateNumbers=0
catenateAll=0 splitOnCaseChange=1/
filter class=solr.LowerCaseFilterFactory/
filter class=solr.SnowballPorterFilterFactory language=English
protected=protwords.txt/
/analyzer
/fieldType



Thanks
Shariq


- character in search query

2011-07-14 Thread roySolr
Hello,

I have some problem with characters in the search term. I have some query's
like this:

Arsenal - london
Ajax - amsterdam
Arsenal - moskou
Arsenal - China

When i send arsenal - london to SOLR i get 2 results, China and moskou. I
looked in the debugQuery and it looks like solr is searching for Arsenal
that's not in london. How can i fix that SOLR handle the - as normal text?

i tried something like this but it's not working:
charFilter class=solr.PatternReplaceCharFilterFactory pattern=-
replacement=/

Quotes is working(Arsenal - london) but then i cannot search for london
arsenal anymore.


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


Re:- character in search query

2011-07-14 Thread 方振鹏
using '\' to escape.
Best Wishes.
 
--
 Best wishes 
  
 James Bond Fang
  
 方 振鹏 
  
 Dept. Software Engineering
  
 Xiamen University



 
 
 
-- Original --
From: roySolr; 
Date: 2011年7月14日(星期四) 下午5:29
To: solr-user; 
Subject: - character in search query

 
Hello,

I have some problem with characters in the search term. I have some query's
like this:

Arsenal - london
Ajax - amsterdam
Arsenal - moskou
Arsenal - China

When i send arsenal - london to SOLR i get 2 results, China and moskou. I
looked in the debugQuery and it looks like solr is searching for Arsenal
that's not in london. How can i fix that SOLR handle the - as normal text?

i tried something like this but it's not working:
charFilter class=solr.PatternReplaceCharFilterFactory pattern=-
replacement=/

Quotes is working(Arsenal - london) but then i cannot search for london
arsenal anymore.


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

Re: - character in search query

2011-07-14 Thread James Bond Fang
Using '\' to escape.

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


Re: - character in search query

2011-07-14 Thread roySolr
thanks!

I use the escape function of the solr pecl package to escape special
characters

http://docs.php.net/manual/kr/solrutils.escapequerychars.php

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


Re: (Solr-UIMA) Indexing problems with UIMA fields.

2011-07-14 Thread Tommaso Teofili
2011/7/13 Sowmya V.B. vbsow...@gmail.com

 Hello Tomasso

 Thanks for the reply.

 I did added uima chain to /javabin handler as you suggested. Now, I get an
 internal server error!

 Here is the stacktrace.

 request:
 http://localhost:8080/apache-solr-3.3.0/update/javabin?wt=javabinversion=2
 org.apache.solr.common.SolrException: Internal Server Error

 Internal Server Error

 request:
 http://localhost:8080/apache-solr-3.3.0/update/javabin?wt=javabinversion=2
at

 org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:435)
at

 org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:244)
at

 org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:105)
at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:49)
at indexerapp.ir4llSolrIndexer.indexAll(ir4llSolrIndexer.java:150)


 Now, I began tracing back from the instructional README.txt file. A few
 doubts:

 1) copy generated solr-uima jar and its libs (under contrib/uima/lib)
 inside
 a Solr libraries directory. or set lib/ tags in solrconfig.xml
 appropriately to point those jar files. lib dir=../../contrib/uima/lib
 /
 lib dir=../../dist/ regex=apache-solr-uima-\d.*\.jar /
 -Which Solr Libraries directory does this refer to??


this refers to:

commons-digester-2.0.jar
uima-an-alchemy-2.3.1-SNAPSHOT-r1062868.jar
uima-an-calais-2.3.1-SNAPSHOT-r1062868.jar
uima-an-tagger-2.3.1-SNAPSHOT-r1062868.jar
uima-an-wst-2.3.1-SNAPSHOT-r1076132.jar
uimaj-core-2.3.1.jar

you can find them at:
http://svn.apache.org/repos/asf/lucene/dev/tags/lucene_solr_3_3/solr/contrib/uima/lib/




 Does it refer to the
 Lib director inside the WEB-INF folder of the Solr webapp?


no, the relative paths in the README and sample solrconfig.xml files refer
to the source code structure.
However, since you're working from Eclipse and it's not always
straightforward to understand what's the base directory for Eclipse, I'd
advice to use absolute paths to start and then eventually switch to relative
ones when everything's ok.



 2)

 lst name=analyzeFields
  bool name=mergefalse/bool
  arr name=fields
strtext/str
  /arr
/lst

 -the only field I need to send through the pipeline is text field. Is it
 enough if I specify that inside SolrConfig in this point...or should I do
 something more?


this is ok



 3) Where can I see a more detailed Log about what is happening inside Solr?
 I am running Solr from Eclipse + Tomcat. Neither the Console nor the
 Eclipse
 Tomcat log show me a detailed errorlog.


you can change the logging levels from :
http://solrurl:solrport/solr/admin/logging

Hope this helps,
Tommaso



 S
 On Wed, Jul 13, 2011 at 4:48 PM, Tommaso Teofili
 tommaso.teof...@gmail.comwrote:

  Hello,
 
  I think the problem might be the following, if you defined the update
  request handlers like in the sample solrconfig :
 
  updateRequestProcessorChain name=uima
  processor
  class=org.apache.solr.uima.processor.UIMAUpdateRequestProcessorFactory
   lst name=uimaConfig
  
  /updateRequestProcessorChain
 
  requestHandler name=/update class=solr.XmlUpdateRequestHandler
 lst name=defaults
   str name=update.chainuima/str
 /lst
   /requestHandler
  ...
   requestHandler name=/update/javabin
  class=solr.BinaryUpdateRequestHandler /
 
  then the uima update chain will be executed only for HTTP POSTs on
 /update
  and not for /update/javabin (that is used by SolrJ), so you may need to
  update the /update/javabin configuration as follows:
 
  requestHandler name=/update/javabin
  class=solr.BinaryUpdateRequestHandler 
   lst name=defaults
   str name=update.chainuima/str
 /lst
  /requestHandler
 
  Hope this helps,
  Tommaso
 
 
  2011/7/13 Erick Erickson erickerick...@gmail.com
 
   I'll have to punt here. I don't know the internals well enough to say.
 I
   suppose
   it's possible that the required fields check happens *before* the
 UIMA
   stuff happens, but since I know so little about UIMA that's a blind
 guess
   at best...
  
   Anyone with real knowledge want to chime in here?
  
   Erick
  
   On Wed, Jul 13, 2011 at 8:08 AM, Sowmya V.B. vbsow...@gmail.com
 wrote:
Hi Eric*
   
   If I'm reading this right, you're labeling certain fields as
 required.
   All
docs MUST have those fields (I admit the error message could be more
informative). So it sounds like things are behaving as I'd expect,
 your
documents just don't contain the required fields.*
- But, the UIMA pipeline is supposed to add the missing fields for
 the
document.
   
Since ant clean dist compiled without build errors, and it was
   essentially
the same pipeline I already used before on a different indexer, I can
  say
that there is no problem with the Pipeline as such.
   
That again gets back my other query: While indexing, should I mention
something 

Re: - character in search query

2011-07-14 Thread roySolr
It looks like it's still not working.

I send this to SOLR: q=arsenal \- london

I get no results. When i look at the debugQuery i see this:

(name: arsenal | city:arsenal)~1.0 (name: \ | city:\)~1.0 (name: london |
city: london)~1.0


my requesthandler:

requestHandler name=dismax class=solr.SearchHandler default=true
lst name=defaults
 str name=defTypedismax/str
 str name=qf
name city
 /str
/lst
  /requestHandler

What is going wrong?

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


Re: - character in search query

2011-07-14 Thread François Schiettecatte
Easy, the hyphen is out on its own (with spaces on either side) and is probably 
getting removed from the search by the tokenizer. Check your analysis.

François

On Jul 14, 2011, at 6:05 AM, roySolr wrote:

 It looks like it's still not working.
 
 I send this to SOLR: q=arsenal \- london
 
 I get no results. When i look at the debugQuery i see this:
 
 (name: arsenal | city:arsenal)~1.0 (name: \ | city:\)~1.0 (name: london |
 city: london)~1.0
 
 
 my requesthandler:
 
requestHandler name=dismax class=solr.SearchHandler default=true
lst name=defaults
str name=defTypedismax/str
str name=qf
   name city
/str
   /lst
  /requestHandler
 
 What is going wrong?
 
 --
 View this message in context: 
 http://lucene.472066.n3.nabble.com/character-in-search-query-tp3168604p3168666.html
 Sent from the Solr - User mailing list archive at Nabble.com.



Re: how to do ExactMatch for PhraseQuery

2011-07-14 Thread Ahmet Arslan

Not sure but, don't you need to use CommonGramsQueryFilterFactory at query time?

http://lucene.apache.org/solr/api/org/apache/solr/analysis/CommonGramsQueryFilter.html

--- On Thu, 7/14/11, Mohammad Shariq shariqn...@gmail.com wrote:

 From: Mohammad Shariq shariqn...@gmail.com
 Subject: how to do ExactMatch for PhraseQuery
 To: solr-user@lucene.apache.org
 Date: Thursday, July 14, 2011, 12:26 PM
 I need exact match On PhraseQuery.
 when I search for the phrase call it
 spring   I get the result for :
 1) It's spring
 2) The spring
 
 but my requirement is ExactMatch for PhraseQuery.
 my search field is text.
 Along with PhraseQuery I am doing RegularQuery too.
 how to tune the solr to do Exactmatch for PhraseQuery
 without affecting
 RegularQuery.
 
 below is text field of schema.xml.
 
 fieldType name=text class=solr.TextField
 positionIncrementGap=100
     analyzer type=index
     tokenizer
 class=solr.WhitespaceTokenizerFactory/
     filter
 class=solr.CommonGramsFilterFactory words=stopwords.txt
 maxShingleSize=3 ignoreCase=true/
     filter
 class=solr.WordDelimiterFilterFactory
 generateWordParts=1
 generateNumberParts=1 catenateWords=1
 catenateNumbers=1
 catenateAll=0 splitOnCaseChange=1/
     filter
 class=solr.LowerCaseFilterFactory/
     filter
 class=solr.SnowballPorterFilterFactory language=English
 protected=protwords.txt/
 
     /analyzeranalyzer
 type=query
     tokenizer
 class=solr.WhitespaceTokenizerFactory/
     filter
 class=solr.CommonGramsFilterFactory words=stopwords.txt
 maxShingleSize=3 ignoreCase=true/
     filter
 class=solr.WordDelimiterFilterFactory
 generateWordParts=1
 generateNumberParts=1 catenateWords=0
 catenateNumbers=0
 catenateAll=0 splitOnCaseChange=1/
     filter
 class=solr.LowerCaseFilterFactory/
     filter
 class=solr.SnowballPorterFilterFactory language=English
 protected=protwords.txt/
     /analyzer
 /fieldType
 
 
 
 Thanks
 Shariq



Re: SolrJ Collapsable Query Fails

2011-07-14 Thread Ahmet Arslan

See the Yonik's reply : http://search-lucene.com/m/tCmky1v94D92/

In short you need to use NamedListObject getResponse().

 I am currently trying to run a
 collapsable query using SolrJ using SolR 3.3.
 The problem is that when I run the query through the web
 interface, with
 this url:
 
 http://localhost:8080/solr/select/?q=attr_content%3Alynxsort=attr_location+descgroup=truegroup.field=attr_directory
 
 I am able to see the XML which is returned. The problem
 though, is that when
 I try to run the same query through SolrJ, using this
 code:
 
         SolrQuery queryString = new
 SolrQuery();
 
         for (String param :
 query.keySet())
 
         {
             if
 (param.equals(fq))
 
             {
                
 queryString.addFilterQuery(query.get(param));
 
             }
             else
             {
                
 queryString.setParam(param, query.get(param));
 
             }
         }
 
        
 System.out.println(queryString.toString());
 
         QueryResponse response =
 server.query(queryString);
 //Exception takes place at this line
 
         SolrDocumentList docList =
 response.getResults();
 
 Which constructs a URL like so:
 
 q=attr_content%3Alynxsort=attr_location+descgroup=truegroup.field=attr_directory
 
 This throws an exception:
 
 Caused by: org.apache.solr.common.SolrException: parsing
 error at
 org.apache.solr.client.solrj.impl.XMLResponseParser.processResponse(XMLResponseParser.java:145)
 at
 org.apache.solr.client.solrj.impl.XMLResponseParser.processResponse(XMLResponseParser.java:106)
 at
 org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:477)
 at
 org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:244)
 at
 org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:89)
 ... 3 more Caused by: javax.xml.stream.XMLStreamException:
 ParseError at
 [row,col]:[3,30088] Message: error reading value:LST at
 org.apache.solr.client.solrj.impl.XMLResponseParser.readArray(XMLResponseParser.java:324)
 at
 org.apache.solr.client.solrj.impl.XMLResponseParser.readNamedList(XMLResponseParser.java:245)
 at
 org.apache.solr.client.solrj.impl.XMLResponseParser.readNamedList(XMLResponseParser.java:244)
 at
 org.apache.solr.client.solrj.impl.XMLResponseParser.readNamedList(XMLResponseParser.java:244)
 at
 org.apache.solr.client.solrj.impl.XMLResponseParser.processResponse(XMLResponseParser.java:130)
 
 I have tried it with both Jetty and Tomcat, the error is
 the same for both.
 I have managed to get other queries to run (with both
 servers), so I presume
 that the problem lies with this particular type of query.
 
 Any insight on this problem will be highly appreciated,
 
 Thanks :)



Re: Preserve XML hierarchy

2011-07-14 Thread Michael Sokolov
Have a look at 
http://wiki.apache.org/solr/DataImportHandler#XPathEntityProcessor


It might be just what you need?

-Mike

On 7/14/2011 3:31 AM, Lucas Miguez wrote:

Hi,

yes, I was asking about it, is it possible to index an XML file?

Is it possible to know which node of the XML the search result comes from?

So I have 2 XML files, the original and the summary. I want to index
the summary. So, that is an example of the summary XML:

Objetives
   Activity xpath=2_3
 TitlePA./TitleP
 TextPRequisitos generales mínimos exigibles a las
explotaciones para las que se soliciten
las ayudas./TextP
 Part
   TitlePart7. Además, la actividad de la explotación deberá
garantizar:
/TitlePart
   gSubPart
 SubPart
   TextSubParta) Gestión de los medios de 
producción./TextSubPart
 /SubPart
 SubPart
   TextSubPartb) Conservación de elementos propios de la
zona y en consonancia con el medio./TextSubPart
 /SubPart
   /gSubPart
 /Part
   /Activity
/Objectives

That is an summary of my original XML file. So, the xpath atribute in
Activity Element shows me the way to retrieve the information in the
original file (2_3 : 2 is the second element in PartV, and 3 is the
third Part inside the second PartV).
So, I need to index the fields (TitleP, TextP, TitlePart, TextPart,
TextSubPart. This fields can occur zero or more times), and I want to
know the xpath to the original file for each field, because I need to
show to the user the hierarchy of the results. Following the XML
example: Imagine that the user search the word zona, then I have to
show the TitleP, the TextP, the TitlePart, the TextPart and all the
TextSubPart that are childs of gSubPart.

Is there any example similar to my issue?

Thanks!



2011/7/13 Gora Mohantyg...@mimirtech.com:

On Wed, Jul 13, 2011 at 10:30 PM, Lucas Miguezlucas.mig...@gmail.com  wrote:

Hi,

is it possible to do that in Apache Solr? If i make a search, how I
know from where it comes the result?

[...]

Your question is not very clear, and I happen unfortunately to be
out of crystal balls and Tarot cards.

Is it possible to do what? Make a search on what, and what sort
of results do you you expect from said search?

Peering into the misty depths of my non-existent crystal ball,
if you are asking is it possible to index an XML file, search it,
and figure out which node of the XML the search result comes
from, yes that is possible; though details, and better advice
would require more input from your side. Roughly speaking,
each node can go into a separate Solr field, and full-text
search on all relevant fields is also possible. Joking aside, please
do provide more details.

Regards,
Gora





Re: how to do ExactMatch for PhraseQuery

2011-07-14 Thread in.abdul
use* keywordfilter *that will helpfull for your requirement

Thanks and Regards,
S SYED ABDUL KATHER
9731841519


On Thu, Jul 14, 2011 at 2:57 PM, Mohammad Shariq [via Lucene] 
ml-node+3168601-303697702-389...@n3.nabble.com wrote:

 I need exact match On PhraseQuery.
 when I search for the phrase call it spring   I get the result for :
 1) It's spring
 2) The spring

 but my requirement is ExactMatch for PhraseQuery.
 my search field is text.
 Along with PhraseQuery I am doing RegularQuery too.
 how to tune the solr to do Exactmatch for PhraseQuery without affecting
 RegularQuery.

 below is text field of schema.xml.

 fieldType name=text class=solr.TextField positionIncrementGap=100
 analyzer type=index
 tokenizer class=solr.WhitespaceTokenizerFactory/
 filter class=solr.CommonGramsFilterFactory words=stopwords.txt
 maxShingleSize=3 ignoreCase=true/
 filter class=solr.WordDelimiterFilterFactory generateWordParts=1
 generateNumberParts=1 catenateWords=1 catenateNumbers=1
 catenateAll=0 splitOnCaseChange=1/
 filter class=solr.LowerCaseFilterFactory/
 filter class=solr.SnowballPorterFilterFactory language=English
 protected=protwords.txt/

 /analyzeranalyzer type=query
 tokenizer class=solr.WhitespaceTokenizerFactory/
 filter class=solr.CommonGramsFilterFactory words=stopwords.txt
 maxShingleSize=3 ignoreCase=true/
 filter class=solr.WordDelimiterFilterFactory generateWordParts=1
 generateNumberParts=1 catenateWords=0 catenateNumbers=0
 catenateAll=0 splitOnCaseChange=1/
 filter class=solr.LowerCaseFilterFactory/
 filter class=solr.SnowballPorterFilterFactory language=English
 protected=protwords.txt/
 /analyzer
 /fieldType



 Thanks
 Shariq


 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://lucene.472066.n3.nabble.com/how-to-do-ExactMatch-for-PhraseQuery-tp3168601p3168601.html
  To unsubscribe from Lucene, click 
 herehttp://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=472066code=aW4uYWJkdWxAZ21haWwuY29tfDQ3MjA2NnwxMDczOTUyNDEw.




-
THANKS AND REGARDS,
SYED ABDUL KATHER
--
View this message in context: 
http://lucene.472066.n3.nabble.com/how-to-do-ExactMatch-for-PhraseQuery-tp3168601p3168677.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Readercycle script issue

2011-07-14 Thread Koji Sekiguchi

(11/07/14 13:12), Pawan Darira wrote:

Hi

my readercycle script is not reloading the searcher. where i may be wrong.
please help


readercycle is somewhat old or broken and it's been removed at SOLR-2046.
I recommend you to use commit script instead:

https://issues.apache.org/jira/browse/SOLR-2046?focusedCommentId=12898513page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12898513

koji
--
http://www.rondhuit.com/en/


Stored Field

2011-07-14 Thread lee carroll
Hi
Do Stored field values get added to the index for each document field
combination literally or is a pointer used ?
I've been reading http://lucene.apache.org/java/2_4_0/fileformats.pdf
and I think thats the case but not 100% so thought I'd ask.

In logical terms for stored fields do we get this sort of storage:

doc0 field0  xxx xx xx xx xx xx xx xx xx xxx
doc0field1  yyy yy yy yy yy yy yy yy yyy
doc1 field0  xxx xx xx xx xx xx xx xx xx xxx
doc1field1  yyy yy yy yy yy yy yy yy yyy

or this:

doc0 field0  {1}
doc0field1  {2}
doc1 field0  {1}
doc1field1  {2}

val1 xxx xx xx xx xx xx xx xx xx xxx
val2 yyy yy yy yy yy yy yy yy yyy

I'm trying to understand possible impact of storing fields which have
a small set of repeating values, hoping it would not have an impact on
file size. But I'm now think it will?

thanks in advance


Re: - character in search query

2011-07-14 Thread roySolr
Yes, i had some tokenizer like this:

tokenizer class=solr.PatternTokenizerFactory pattern=\s|-|, /

Now i removed the - from this tokenizer and the debugQuery looks like this:

(name:arsenal | city:arsenal)~1.0 (name:\- | city:\-)~1.0 (name:london |
city:london)~1.0 

Still i get no results..

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


return distance in geo spatial query

2011-07-14 Thread Zoltan Altfatter
Hi,

Would be interested in the status of the development in returning the
distance in a spatial query?
I would need the distance to be returned but also would need the
document score which is related to other criteria.

I am using solr 3.1.

Zoltan


Re: Multivalued field: get only the str that matches with the query

2011-07-14 Thread Tomás Fernández Löbbe
I once achieve this by using the highlighting feature, I don't know if there
is a more direct way of doing it.

On Wed, Jul 13, 2011 at 1:51 PM, Lucas Miguez lucas.mig...@gmail.comwrote:

 Hi all,

 I have a multivalued field. I need to make a search in the multivalued
 field and get only the values that match with the query.

 Example:

 doc
 field name=textaaa bbb ccc/field
 field name=textaaa/field
 field name=textccc/field
 /doc

 So, if I make a search like text:aaa the 3 values are returned, when
 only results one and two are the correct.

 I am using the WhitespaceTokenizer in the index and in the query analyzers:
 types
   fieldtype name=string  class=solr.TextField
 positionIncrementGap=100 autoGeneratePhraseQueries=true
   analyzer type=index
tokenizer class=solr.WhitespaceTokenizerFactory/
   /analyzer
   analyzer type=query
tokenizer class=solr.WhitespaceTokenizerFactory/
/analyzer
   /fieldtype
  /types


 How to do that on Apache Solr?

 Thanks!



Problem with Filter Query

2011-07-14 Thread Kissue Kissue
Hi,

I am using Solr 3.1 with SolrJ. I have a field called supplierName in my
index which i am trying to do filtering on. When i select about 5 suppliers
to filter on at the same time and use their supplier name to contruct a
filter query i do not get any results but when i filter which each
individual supplier name i get the required results.

Here is the line code to that i used to contruct the filter query:

*solrQuery.setParam(fq, arrayOfSupplierNames);

*The supplier name field is stored as a string in the index and here is the
config for the string type from my schema.xml file:

!-- The StrField type is not analyzed, but indexed/stored verbatim. --
fieldType name=string class=solr.StrField sortMissingLast=true
omitNorms=true/

Any help why this is happening will be much appreciated.

Thanks.


Re: return distance in geo spatial query

2011-07-14 Thread Yonik Seeley
On Thu, Jul 14, 2011 at 8:42 AM, Zoltan Altfatter altfatt...@gmail.com wrote:
 Would be interested in the status of the development in returning the
 distance in a spatial query?

This is a feature in trunk (pseudo-fields).
For example:
  fl=id,score,geodist()


-Yonik
http://www.lucidimagination.com


Re: (Solr-UIMA) Indexing problems with UIMA fields.

2011-07-14 Thread Sowmya V.B.
Hi All

I worked without integrating UIMA in to Solr but doing it seperately..and it
worked now!

I did not use the Solr-UIMA update processor this time. What I did is this:
1) Take the document, extract the static fields i need... and later send it
in to the pipeline.
2) Take the output of the pipeline and extract all the key-value pairs, and
add them to solrdoc. (this was the approach followed, before using Solr,
with a lucene based indexer wrote within the team!)
3) Now add the Document to a Collection of SolrDocs
4) Commit to the server every few docs.

I was able to index a trial sample of 100 Docs with all the UIMA fields. So,
I am hoping that this is going to work for bigger set of documents!

Thanks for all the suggestions over the past few days!!

S

On Thu, Jul 14, 2011 at 11:48 AM, Tommaso Teofili tommaso.teof...@gmail.com
 wrote:

 2011/7/13 Sowmya V.B. vbsow...@gmail.com

  Hello Tomasso
 
  Thanks for the reply.
 
  I did added uima chain to /javabin handler as you suggested. Now, I get
 an
  internal server error!
 
  Here is the stacktrace.
 
  request:
 
 http://localhost:8080/apache-solr-3.3.0/update/javabin?wt=javabinversion=2
  org.apache.solr.common.SolrException: Internal Server Error
 
  Internal Server Error
 
  request:
 
 http://localhost:8080/apache-solr-3.3.0/update/javabin?wt=javabinversion=2
 at
 
 
 org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:435)
 at
 
 
 org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:244)
 at
 
 
 org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:105)
 at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:49)
 at indexerapp.ir4llSolrIndexer.indexAll(ir4llSolrIndexer.java:150)
 
 
  Now, I began tracing back from the instructional README.txt file. A few
  doubts:
 
  1) copy generated solr-uima jar and its libs (under contrib/uima/lib)
  inside
  a Solr libraries directory. or set lib/ tags in solrconfig.xml
  appropriately to point those jar files. lib dir=../../contrib/uima/lib
  /
  lib dir=../../dist/ regex=apache-solr-uima-\d.*\.jar /
  -Which Solr Libraries directory does this refer to??


 this refers to:

 commons-digester-2.0.jar
 uima-an-alchemy-2.3.1-SNAPSHOT-r1062868.jar
 uima-an-calais-2.3.1-SNAPSHOT-r1062868.jar
 uima-an-tagger-2.3.1-SNAPSHOT-r1062868.jar
 uima-an-wst-2.3.1-SNAPSHOT-r1076132.jar
 uimaj-core-2.3.1.jar

 you can find them at:

 http://svn.apache.org/repos/asf/lucene/dev/tags/lucene_solr_3_3/solr/contrib/uima/lib/




  Does it refer to the
  Lib director inside the WEB-INF folder of the Solr webapp?
 

 no, the relative paths in the README and sample solrconfig.xml files refer
 to the source code structure.
 However, since you're working from Eclipse and it's not always
 straightforward to understand what's the base directory for Eclipse, I'd
 advice to use absolute paths to start and then eventually switch to
 relative
 ones when everything's ok.


 
  2)
 
  lst name=analyzeFields
   bool name=mergefalse/bool
   arr name=fields
 strtext/str
   /arr
 /lst
 
  -the only field I need to send through the pipeline is text field. Is
 it
  enough if I specify that inside SolrConfig in this point...or should I do
  something more?
 

 this is ok


 
  3) Where can I see a more detailed Log about what is happening inside
 Solr?
  I am running Solr from Eclipse + Tomcat. Neither the Console nor the
  Eclipse
  Tomcat log show me a detailed errorlog.
 

 you can change the logging levels from :
 http://solrurl:solrport/solr/admin/logging

 Hope this helps,
 Tommaso


 
  S
  On Wed, Jul 13, 2011 at 4:48 PM, Tommaso Teofili
  tommaso.teof...@gmail.comwrote:
 
   Hello,
  
   I think the problem might be the following, if you defined the update
   request handlers like in the sample solrconfig :
  
   updateRequestProcessorChain name=uima
   processor
  
 class=org.apache.solr.uima.processor.UIMAUpdateRequestProcessorFactory
lst name=uimaConfig
   
   /updateRequestProcessorChain
  
   requestHandler name=/update class=solr.XmlUpdateRequestHandler
  lst name=defaults
str name=update.chainuima/str
  /lst
/requestHandler
   ...
requestHandler name=/update/javabin
   class=solr.BinaryUpdateRequestHandler /
  
   then the uima update chain will be executed only for HTTP POSTs on
  /update
   and not for /update/javabin (that is used by SolrJ), so you may need to
   update the /update/javabin configuration as follows:
  
   requestHandler name=/update/javabin
   class=solr.BinaryUpdateRequestHandler 
lst name=defaults
str name=update.chainuima/str
  /lst
   /requestHandler
  
   Hope this helps,
   Tommaso
  
  
   2011/7/13 Erick Erickson erickerick...@gmail.com
  
I'll have to punt here. I don't know the internals well enough to
 say.
  I
suppose
it's possible that 

Re: Problem with Filter Query

2011-07-14 Thread Edoardo Tosca
Hi,
have you tried with:
solrQuery.addFilterQuery(arrayOfSupplierNames) ?

other question, is every element of your array composed in this way:
supplierName:FIRST
supplierName:SECOND
etc..

HTH
edo

On Thu, Jul 14, 2011 at 2:18 PM, Kissue Kissue kissue...@gmail.com wrote:

 Hi,

 I am using Solr 3.1 with SolrJ. I have a field called supplierName in my
 index which i am trying to do filtering on. When i select about 5 suppliers
 to filter on at the same time and use their supplier name to contruct a
 filter query i do not get any results but when i filter which each
 individual supplier name i get the required results.

 Here is the line code to that i used to contruct the filter query:

 *solrQuery.setParam(fq, arrayOfSupplierNames);

 *The supplier name field is stored as a string in the index and here is the
 config for the string type from my schema.xml file:

 !-- The StrField type is not analyzed, but indexed/stored verbatim. --
fieldType name=string class=solr.StrField sortMissingLast=true
 omitNorms=true/

 Any help why this is happening will be much appreciated.

 Thanks.




-- 
Edoardo Tosca
Sourcesense - making sense of Open Source: http://www.sourcesense.com


Re: Problem with Filter Query

2011-07-14 Thread Kissue Kissue
Thanks for your response.

Actually the elements are composed as follows:
fq=firstfq=second

But using Solr admin query screen i have modified the query to:
fq=supplierName:firstfq=supplierName:second
i still get the same results.

I will try to use solrQuery.addFilterQuery(arrayOfSupplierNames) like you
suggested and see how it goes.

Thanks.


On Thu, Jul 14, 2011 at 2:49 PM, Edoardo Tosca e.to...@sourcesense.comwrote:

 Hi,
 have you tried with:
 solrQuery.addFilterQuery(arrayOfSupplierNames) ?

 other question, is every element of your array composed in this way:
 supplierName:FIRST
 supplierName:SECOND
 etc..

 HTH
 edo

 On Thu, Jul 14, 2011 at 2:18 PM, Kissue Kissue kissue...@gmail.com
 wrote:

  Hi,
 
  I am using Solr 3.1 with SolrJ. I have a field called supplierName in my
  index which i am trying to do filtering on. When i select about 5
 suppliers
  to filter on at the same time and use their supplier name to contruct a
  filter query i do not get any results but when i filter which each
  individual supplier name i get the required results.
 
  Here is the line code to that i used to contruct the filter query:
 
  *solrQuery.setParam(fq, arrayOfSupplierNames);
 
  *The supplier name field is stored as a string in the index and here is
 the
  config for the string type from my schema.xml file:
 
  !-- The StrField type is not analyzed, but indexed/stored verbatim. --
 fieldType name=string class=solr.StrField sortMissingLast=true
  omitNorms=true/
 
  Any help why this is happening will be much appreciated.
 
  Thanks.
 



 --
 Edoardo Tosca
 Sourcesense - making sense of Open Source: http://www.sourcesense.com



Re: Problem with Filter Query

2011-07-14 Thread Edoardo Tosca
So with
fq=supplierName:firstfq=supplierName:second
you don't get any results?

is this field a multivalue?
Mutliple FQs are evaluated as AND
so your document must have in supplierName both first and second

Edo


On Thu, Jul 14, 2011 at 3:00 PM, Kissue Kissue kissue...@gmail.com wrote:

 Thanks for your response.

 Actually the elements are composed as follows:
 fq=firstfq=second

 But using Solr admin query screen i have modified the query to:
 fq=supplierName:firstfq=supplierName:second
 i still get the same results.

 I will try to use solrQuery.addFilterQuery(arrayOfSupplierNames) like you
 suggested and see how it goes.

 Thanks.


 On Thu, Jul 14, 2011 at 2:49 PM, Edoardo Tosca e.to...@sourcesense.com
 wrote:

  Hi,
  have you tried with:
  solrQuery.addFilterQuery(arrayOfSupplierNames) ?
 
  other question, is every element of your array composed in this way:
  supplierName:FIRST
  supplierName:SECOND
  etc..
 
  HTH
  edo
 
  On Thu, Jul 14, 2011 at 2:18 PM, Kissue Kissue kissue...@gmail.com
  wrote:
 
   Hi,
  
   I am using Solr 3.1 with SolrJ. I have a field called supplierName in
 my
   index which i am trying to do filtering on. When i select about 5
  suppliers
   to filter on at the same time and use their supplier name to contruct a
   filter query i do not get any results but when i filter which each
   individual supplier name i get the required results.
  
   Here is the line code to that i used to contruct the filter query:
  
   *solrQuery.setParam(fq, arrayOfSupplierNames);
  
   *The supplier name field is stored as a string in the index and here is
  the
   config for the string type from my schema.xml file:
  
   !-- The StrField type is not analyzed, but indexed/stored verbatim.
 --
  fieldType name=string class=solr.StrField
 sortMissingLast=true
   omitNorms=true/
  
   Any help why this is happening will be much appreciated.
  
   Thanks.
  
 
 
 
  --
  Edoardo Tosca
  Sourcesense - making sense of Open Source: http://www.sourcesense.com
 




-- 
Edoardo Tosca
Sourcesense - making sense of Open Source: http://www.sourcesense.com


Re: Upgrading solr from 1.4 to latest version

2011-07-14 Thread Edoardo Tosca
I think that at the moment there isn't any Ubuntu package available with
solr 3.x
My suggestion is to uninstall it (via apt-get) and install solr manually
in your /opt or wherever you want
After all what you have to do is easily extract the zipped archive.


Edo

On Wed, Jul 13, 2011 at 1:35 AM, rvidela ravi.vid...@gmail.com wrote:

 Hi,

 I am new to Solr. In little time, I am very much impressed with its search
 performance. I have installed Solr on Ubuntu using *apt-get install
 solr-tomcat curl -y* command. From admin page, I can see that solr version
 is 1.4.1. But i see there is 3.x version already available. Just wondering
 if there is any easy way to upgrade it to latest version.

 Tried specifying version number in apt-get, But it does not work.
 Appreciate
 your help.

 Thanks
 Ravi

 --
 View this message in context:
 http://lucene.472066.n3.nabble.com/Upgrading-solr-from-1-4-to-latest-version-tp3164312p3164312.html
 Sent from the Solr - User mailing list archive at Nabble.com.




-- 
Edoardo Tosca
Sourcesense - making sense of Open Source: http://www.sourcesense.com


Re: Problem with Filter Query

2011-07-14 Thread Kissue Kissue
No its not a multivalue field. Yes i can see that it looks like its doing an
AND on all the filter values but how can i get it to do an OR?
I just want it to return documents that have any of the supplied values as
their supplier name.

I have also tried: solrQuery.addFilterQuery(arrayOfSupplierNames) and i get
no results too.

Thanks.

On Thu, Jul 14, 2011 at 3:06 PM, Edoardo Tosca e.to...@sourcesense.comwrote:

 So with
 fq=supplierName:firstfq=supplierName:second
 you don't get any results?

 is this field a multivalue?
 Mutliple FQs are evaluated as AND
 so your document must have in supplierName both first and second

 Edo


 On Thu, Jul 14, 2011 at 3:00 PM, Kissue Kissue kissue...@gmail.com
 wrote:

  Thanks for your response.
 
  Actually the elements are composed as follows:
  fq=firstfq=second
 
  But using Solr admin query screen i have modified the query to:
  fq=supplierName:firstfq=supplierName:second
  i still get the same results.
 
  I will try to use solrQuery.addFilterQuery(arrayOfSupplierNames) like you
  suggested and see how it goes.
 
  Thanks.
 
 
  On Thu, Jul 14, 2011 at 2:49 PM, Edoardo Tosca e.to...@sourcesense.com
  wrote:
 
   Hi,
   have you tried with:
   solrQuery.addFilterQuery(arrayOfSupplierNames) ?
  
   other question, is every element of your array composed in this way:
   supplierName:FIRST
   supplierName:SECOND
   etc..
  
   HTH
   edo
  
   On Thu, Jul 14, 2011 at 2:18 PM, Kissue Kissue kissue...@gmail.com
   wrote:
  
Hi,
   
I am using Solr 3.1 with SolrJ. I have a field called supplierName in
  my
index which i am trying to do filtering on. When i select about 5
   suppliers
to filter on at the same time and use their supplier name to contruct
 a
filter query i do not get any results but when i filter which each
individual supplier name i get the required results.
   
Here is the line code to that i used to contruct the filter query:
   
*solrQuery.setParam(fq, arrayOfSupplierNames);
   
*The supplier name field is stored as a string in the index and here
 is
   the
config for the string type from my schema.xml file:
   
!-- The StrField type is not analyzed, but indexed/stored verbatim.
  --
   fieldType name=string class=solr.StrField
  sortMissingLast=true
omitNorms=true/
   
Any help why this is happening will be much appreciated.
   
Thanks.
   
  
  
  
   --
   Edoardo Tosca
   Sourcesense - making sense of Open Source: http://www.sourcesense.com
  
 



 --
 Edoardo Tosca
 Sourcesense - making sense of Open Source: http://www.sourcesense.com



Re: Problem with Filter Query

2011-07-14 Thread Edoardo Tosca
As far as i know if you add multiple FQs they will be joined always with
AND.
You can do something like
fq={!q.op=OR df=supplierName}first second third ...

HTH

Edo


On Thu, Jul 14, 2011 at 3:50 PM, Kissue Kissue kissue...@gmail.com wrote:

 No its not a multivalue field. Yes i can see that it looks like its doing
 an
 AND on all the filter values but how can i get it to do an OR?
 I just want it to return documents that have any of the supplied values as
 their supplier name.

 I have also tried: solrQuery.addFilterQuery(arrayOfSupplierNames) and i get
 no results too.

 Thanks.

 On Thu, Jul 14, 2011 at 3:06 PM, Edoardo Tosca e.to...@sourcesense.com
 wrote:

  So with
  fq=supplierName:firstfq=supplierName:second
  you don't get any results?
 
  is this field a multivalue?
  Mutliple FQs are evaluated as AND
  so your document must have in supplierName both first and second
 
  Edo
 
 
  On Thu, Jul 14, 2011 at 3:00 PM, Kissue Kissue kissue...@gmail.com
  wrote:
 
   Thanks for your response.
  
   Actually the elements are composed as follows:
   fq=firstfq=second
  
   But using Solr admin query screen i have modified the query to:
   fq=supplierName:firstfq=supplierName:second
   i still get the same results.
  
   I will try to use solrQuery.addFilterQuery(arrayOfSupplierNames) like
 you
   suggested and see how it goes.
  
   Thanks.
  
  
   On Thu, Jul 14, 2011 at 2:49 PM, Edoardo Tosca 
 e.to...@sourcesense.com
   wrote:
  
Hi,
have you tried with:
solrQuery.addFilterQuery(arrayOfSupplierNames) ?
   
other question, is every element of your array composed in this way:
supplierName:FIRST
supplierName:SECOND
etc..
   
HTH
edo
   
On Thu, Jul 14, 2011 at 2:18 PM, Kissue Kissue kissue...@gmail.com
wrote:
   
 Hi,

 I am using Solr 3.1 with SolrJ. I have a field called supplierName
 in
   my
 index which i am trying to do filtering on. When i select about 5
suppliers
 to filter on at the same time and use their supplier name to
 contruct
  a
 filter query i do not get any results but when i filter which each
 individual supplier name i get the required results.

 Here is the line code to that i used to contruct the filter query:

 *solrQuery.setParam(fq, arrayOfSupplierNames);

 *The supplier name field is stored as a string in the index and
 here
  is
the
 config for the string type from my schema.xml file:

 !-- The StrField type is not analyzed, but indexed/stored
 verbatim.
   --
fieldType name=string class=solr.StrField
   sortMissingLast=true
 omitNorms=true/

 Any help why this is happening will be much appreciated.

 Thanks.

   
   
   
--
Edoardo Tosca
Sourcesense - making sense of Open Source:
 http://www.sourcesense.com
   
  
 
 
 
  --
  Edoardo Tosca
  Sourcesense - making sense of Open Source: http://www.sourcesense.com
 




-- 
Edoardo Tosca
Sourcesense - making sense of Open Source: http://www.sourcesense.com


Fwd: Preserve XML hierarchy

2011-07-14 Thread Lucas Miguez
Thanks for your help!

DIH XPathEntityProcessor helps me to index the XML Files, but, does it
help to me to know from where the node comes? Following the example in
my previous post:

 example: Imagine that the user search the word zona, then I have to
 show the TitleP, the TextP, the TitlePart, the TextPart and all the
 TextSubPart that are childs of gSubPart.

Well, I tried to create TextPart, TitlePart, etc with the XPath
expression of the location in the original XML, using dynamic fields,
for example:
dynamic field=TextPart * multivalued=true indexed=true ... /

to have the XPath associated with the field, but I don't know how to
search in all TextPart * fields...

Maybe I need to define my own FunctionQuery.

Keep looking for the solution.




2011/7/14 Michael Sokolov
 Have a look at
 http://wiki.apache.org/solr/DataImportHandler#XPathEntityProcessor

 It might be just what you need?

 -Mike

 On 7/14/2011 3:31 AM, Lucas Miguez wrote:

 Hi,

 yes, I was asking about it, is it possible to index an XML file?

 Is it possible to know which node of the XML the search result comes from?

 So I have 2 XML files, the original and the summary. I want to index
 the summary. So, that is an example of the summary XML:

 Objetives
       Activity xpath=2_3
         TitlePA./TitleP
         TextPRequisitos generales mínimos exigibles a las
 explotaciones para las que se soliciten
 las ayudas./TextP
         Part
           TitlePart7. Además, la actividad de la explotación deberá
 garantizar:
 /TitlePart
           gSubPart
             SubPart
               TextSubParta) Gestión de los medios de
 producción./TextSubPart
             /SubPart
             SubPart
               TextSubPartb) Conservación de elementos propios de la
 zona y en consonancia con el medio./TextSubPart
             /SubPart
           /gSubPart
         /Part
       /Activity
 /Objectives

 That is an summary of my original XML file. So, the xpath atribute in
 Activity Element shows me the way to retrieve the information in the
 original file (2_3 : 2 is the second element in PartV, and 3 is the
 third Part inside the second PartV).
 So, I need to index the fields (TitleP, TextP, TitlePart, TextPart,
 TextSubPart. This fields can occur zero or more times), and I want to
 know the xpath to the original file for each field, because I need to
 show to the user the hierarchy of the results. Following the XML
 example: Imagine that the user search the word zona, then I have to
 show the TitleP, the TextP, the TitlePart, the TextPart and all the
 TextSubPart that are childs of gSubPart.

 Is there any example similar to my issue?

 Thanks!



 2011/7/13 Gora Mohantyg...@mimirtech.com:

 On Wed, Jul 13, 2011 at 10:30 PM, Lucas Miguezlucas.mig...@gmail.com
  wrote:

 Hi,

 is it possible to do that in Apache Solr? If i make a search, how I
 know from where it comes the result?

 [...]

 Your question is not very clear, and I happen unfortunately to be
 out of crystal balls and Tarot cards.

 Is it possible to do what? Make a search on what, and what sort
 of results do you you expect from said search?

 Peering into the misty depths of my non-existent crystal ball,
 if you are asking is it possible to index an XML file, search it,
 and figure out which node of the XML the search result comes
 from, yes that is possible; though details, and better advice
 would require more input from your side. Roughly speaking,
 each node can go into a separate Solr field, and full-text
 search on all relevant fields is also possible. Joking aside, please
 do provide more details.

 Regards,
 Gora





Re: Problem with Filter Query

2011-07-14 Thread Kissue Kissue
I have tried this but not working too. Thanks for your help.


On Thu, Jul 14, 2011 at 3:59 PM, Edoardo Tosca e.to...@sourcesense.comwrote:

 As far as i know if you add multiple FQs they will be joined always with
 AND.
 You can do something like
 fq={!q.op=OR df=supplierName}first second third ...

 HTH

 Edo


 On Thu, Jul 14, 2011 at 3:50 PM, Kissue Kissue kissue...@gmail.com
 wrote:

  No its not a multivalue field. Yes i can see that it looks like its doing
  an
  AND on all the filter values but how can i get it to do an OR?
  I just want it to return documents that have any of the supplied values
 as
  their supplier name.
 
  I have also tried: solrQuery.addFilterQuery(arrayOfSupplierNames) and i
 get
  no results too.
 
  Thanks.
 
  On Thu, Jul 14, 2011 at 3:06 PM, Edoardo Tosca e.to...@sourcesense.com
  wrote:
 
   So with
   fq=supplierName:firstfq=supplierName:second
   you don't get any results?
  
   is this field a multivalue?
   Mutliple FQs are evaluated as AND
   so your document must have in supplierName both first and second
  
   Edo
  
  
   On Thu, Jul 14, 2011 at 3:00 PM, Kissue Kissue kissue...@gmail.com
   wrote:
  
Thanks for your response.
   
Actually the elements are composed as follows:
fq=firstfq=second
   
But using Solr admin query screen i have modified the query to:
fq=supplierName:firstfq=supplierName:second
i still get the same results.
   
I will try to use solrQuery.addFilterQuery(arrayOfSupplierNames) like
  you
suggested and see how it goes.
   
Thanks.
   
   
On Thu, Jul 14, 2011 at 2:49 PM, Edoardo Tosca 
  e.to...@sourcesense.com
wrote:
   
 Hi,
 have you tried with:
 solrQuery.addFilterQuery(arrayOfSupplierNames) ?

 other question, is every element of your array composed in this
 way:
 supplierName:FIRST
 supplierName:SECOND
 etc..

 HTH
 edo

 On Thu, Jul 14, 2011 at 2:18 PM, Kissue Kissue 
 kissue...@gmail.com
 wrote:

  Hi,
 
  I am using Solr 3.1 with SolrJ. I have a field called
 supplierName
  in
my
  index which i am trying to do filtering on. When i select about 5
 suppliers
  to filter on at the same time and use their supplier name to
  contruct
   a
  filter query i do not get any results but when i filter which
 each
  individual supplier name i get the required results.
 
  Here is the line code to that i used to contruct the filter
 query:
 
  *solrQuery.setParam(fq, arrayOfSupplierNames);
 
  *The supplier name field is stored as a string in the index and
  here
   is
 the
  config for the string type from my schema.xml file:
 
  !-- The StrField type is not analyzed, but indexed/stored
  verbatim.
--
 fieldType name=string class=solr.StrField
sortMissingLast=true
  omitNorms=true/
 
  Any help why this is happening will be much appreciated.
 
  Thanks.
 



 --
 Edoardo Tosca
 Sourcesense - making sense of Open Source:
  http://www.sourcesense.com

   
  
  
  
   --
   Edoardo Tosca
   Sourcesense - making sense of Open Source: http://www.sourcesense.com
  
 



 --
 Edoardo Tosca
 Sourcesense - making sense of Open Source: http://www.sourcesense.com



Problem with numFound of grouped

2011-07-14 Thread Dino_BBT
When I used group=true in ver3.4, then I get the numFound includes grouped
record, but I don't get the numFound without grouped, what about I do?
Thanks.

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Problem-with-numFound-of-grouped-tp3169450p3169450.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Problem with Filter Query

2011-07-14 Thread Kissue Kissue
I have eventually gotten it to work with the following:

fq=supplierName:first + supplierName:second + supplierName:third
...

Thanks.

On Thu, Jul 14, 2011 at 4:14 PM, Kissue Kissue kissue...@gmail.com wrote:

 I have tried this but not working too. Thanks for your help.



 On Thu, Jul 14, 2011 at 3:59 PM, Edoardo Tosca e.to...@sourcesense.comwrote:

 As far as i know if you add multiple FQs they will be joined always with
 AND.
 You can do something like
 fq={!q.op=OR df=supplierName}first second third ...

 HTH

 Edo


 On Thu, Jul 14, 2011 at 3:50 PM, Kissue Kissue kissue...@gmail.com
 wrote:

  No its not a multivalue field. Yes i can see that it looks like its
 doing
  an
  AND on all the filter values but how can i get it to do an OR?
  I just want it to return documents that have any of the supplied values
 as
  their supplier name.
 
  I have also tried: solrQuery.addFilterQuery(arrayOfSupplierNames) and i
 get
  no results too.
 
  Thanks.
 
  On Thu, Jul 14, 2011 at 3:06 PM, Edoardo Tosca e.to...@sourcesense.com
  wrote:
 
   So with
   fq=supplierName:firstfq=supplierName:second
   you don't get any results?
  
   is this field a multivalue?
   Mutliple FQs are evaluated as AND
   so your document must have in supplierName both first and second
  
   Edo
  
  
   On Thu, Jul 14, 2011 at 3:00 PM, Kissue Kissue kissue...@gmail.com
   wrote:
  
Thanks for your response.
   
Actually the elements are composed as follows:
fq=firstfq=second
   
But using Solr admin query screen i have modified the query to:
fq=supplierName:firstfq=supplierName:second
i still get the same results.
   
I will try to use solrQuery.addFilterQuery(arrayOfSupplierNames)
 like
  you
suggested and see how it goes.
   
Thanks.
   
   
On Thu, Jul 14, 2011 at 2:49 PM, Edoardo Tosca 
  e.to...@sourcesense.com
wrote:
   
 Hi,
 have you tried with:
 solrQuery.addFilterQuery(arrayOfSupplierNames) ?

 other question, is every element of your array composed in this
 way:
 supplierName:FIRST
 supplierName:SECOND
 etc..

 HTH
 edo

 On Thu, Jul 14, 2011 at 2:18 PM, Kissue Kissue 
 kissue...@gmail.com
 wrote:

  Hi,
 
  I am using Solr 3.1 with SolrJ. I have a field called
 supplierName
  in
my
  index which i am trying to do filtering on. When i select about
 5
 suppliers
  to filter on at the same time and use their supplier name to
  contruct
   a
  filter query i do not get any results but when i filter which
 each
  individual supplier name i get the required results.
 
  Here is the line code to that i used to contruct the filter
 query:
 
  *solrQuery.setParam(fq, arrayOfSupplierNames);
 
  *The supplier name field is stored as a string in the index and
  here
   is
 the
  config for the string type from my schema.xml file:
 
  !-- The StrField type is not analyzed, but indexed/stored
  verbatim.
--
 fieldType name=string class=solr.StrField
sortMissingLast=true
  omitNorms=true/
 
  Any help why this is happening will be much appreciated.
 
  Thanks.
 



 --
 Edoardo Tosca
 Sourcesense - making sense of Open Source:
  http://www.sourcesense.com

   
  
  
  
   --
   Edoardo Tosca
   Sourcesense - making sense of Open Source: http://www.sourcesense.com
  
 



 --
 Edoardo Tosca
 Sourcesense - making sense of Open Source: http://www.sourcesense.com





Re: XInclude Multiple Elements

2011-07-14 Thread Stephen Duncan Jr
I'm also open to ideas on useful ways to use XInclude while only
targeting a single element.  I haven't been able to come up with a way
that that's useful enough for me, but maybe I'm not thinking about the
problem from the proper point of view.  For the schema, I could have
the types as a single include, but for solrconfig.xml I'd want to
share almost all of the configuration except for a few customizations,
and all the elements are within the root.  I can't see how to use
XInclude to be useful for this case.

I'd appreciate any examples people of have of how their using XInclude
for configuration sharing.

Thanks,
Stephen

Stephen Duncan Jr
www.stephenduncanjr.com


On Wed, Jul 13, 2011 at 7:13 PM, Stephen Duncan Jr
stephen.dun...@gmail.com wrote:
 I've spent some time looking at various conversations on this problem,
 but I can't find a solution that works.  XInclude has to point a valid
 XML document, with a single root element.  It should be possible to
 use xpointer to specify children elements to include, but as far as I
 can tell, the xpointer support doesn't include any scheme complex
 enough to express all the child elements of a given element, which
 is what I would like.

 So, here's what I have (it's more complicated than necessary for this
 example because I also want it to support includes for both the root
 level and a sub-level to use when doing schema, as I want to do
 particular fields, but not all of them in the include file):

 includes.dtd

 !ELEMENT includes (include+)
 !ELEMENT include ANY
 !ATTLIST include id ID #REQUIRED

 solrconfigIncludes.xml

 ?xml version=1.0 encoding=UTF-8?
 !DOCTYPE includes SYSTEM includes.dtd
 includes
        include id=root
 ...several elements to be included at the root of a solrconfig.xml file...
        /include
 /includes

 solrconfig.xml

 ?xml version=1.0 encoding=UTF-8 ?
 config
        xi:include href=../../conf/solrconfigIncludes.xml xpointer=root
 xmlns:xi=http://www.w3.org/2001/XInclude; /

        requestHandler name=dismax class=solr.SearchHandler
                lst name=defaults
                        str name=defTypedismax/str
                        str name=echoParamsexplicit/str
                        float name=tie0.01/float
                        str name=qfall_text/str
                        str name=pfall_text/str
                        str 
 name=bfrecip(ms(NOW,dateoccurredboost),3.16e-11,1,1)/str
                        str name=fl/str
                        str name=mm1lt;-1 4lt;-2/str
                        int name=ps100/int
                        str name=q.alt*:*/str
                        str name=hl.flhighlight/str
                /lst

                arr name=last-components
                        strspellcheck/str
                /arr
        /requestHandler
 /config

 So, that xpointer=root, unfortunately, grabs the include id=root
 element, but what I need, of course, is the contents of that element
 (the children).

 I see this post:
 http://lucene.472066.n3.nabble.com/including-external-files-in-config-by-corename-td698324.html
 that implies you can use #xpointer(/*/node()) to get all elements of
 the root node (like if I changed my example to only have one include,
 and just used multiple files, which is fine if it works), however my
 testing gave this error: ERROR org.apache.solr.core.CoreContainer -
 org.xml.sax.SAXParseException: Fragment identifiers must not be used.
 The 'href' attribute value
 '../../conf/solrconfigIncludes.xml#xpointer(root/node())' is not
 permitted.  I tried several other variations of trying to come up with
 pointers using node() or *, none of which worked.

 And I also see this post:
 http://lucene.472066.n3.nabble.com/solrconfig-xml-and-xinclude-td984058.html
 that shows off a cumbersome way to list out each child element by
 index number using the element scheme, which I assume works, but is
 way to cumbersome to use.

 Does any have any success using XInclude to include more than one
 element?  I'm open to any and all approaches to having
 partially-common configuration between cores.

 Thanks,
 Stephen

 --
 Stephen Duncan Jr
 www.stephenduncanjr.com



Re: Upgrading solr from 1.4 to latest version

2011-07-14 Thread rvidela
Thanks Edorado. I will try installing manually.

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Upgrading-solr-from-1-4-to-latest-version-tp3164312p3169768.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Preserve XML hierarchy

2011-07-14 Thread Walter Underwood
This will be much easier on an XML database, because that supports XPath 
natively.

For open source, try eXist.

For a commercial XML database, try MarkLogic (much, much faster than eXist).

wunder
Walter Underwood
Lead Engineer, MarkLogic
www.marklogic.com

On Jul 14, 2011, at 12:31 AM, Lucas Miguez wrote:

 Hi,
 
 yes, I was asking about it, is it possible to index an XML file?
 
 Is it possible to know which node of the XML the search result comes from?
 
 So I have 2 XML files, the original and the summary. I want to index
 the summary. So, that is an example of the summary XML:
 
 Objetives
  Activity xpath=2_3
TitlePA. /TitleP
TextPRequisitos generales mínimos exigibles a las
 explotaciones para las que se soliciten
 las ayudas./TextP
Part
  TitlePart7. Además, la actividad de la explotación deberá
 garantizar:
 /TitlePart
  gSubPart
SubPart
  TextSubParta) Gestión de los medios de 
 producción./TextSubPart
/SubPart
SubPart
  TextSubPartb) Conservación de elementos propios de la
 zona y en consonancia con el medio./TextSubPart
/SubPart
  /gSubPart
/Part
  /Activity
 /Objectives
 
 That is an summary of my original XML file. So, the xpath atribute in
 Activity Element shows me the way to retrieve the information in the
 original file (2_3 : 2 is the second element in PartV, and 3 is the
 third Part inside the second PartV).
 So, I need to index the fields (TitleP, TextP, TitlePart, TextPart,
 TextSubPart. This fields can occur zero or more times), and I want to
 know the xpath to the original file for each field, because I need to
 show to the user the hierarchy of the results. Following the XML
 example: Imagine that the user search the word zona, then I have to
 show the TitleP, the TextP, the TitlePart, the TextPart and all the
 TextSubPart that are childs of gSubPart.
 
 Is there any example similar to my issue?
 
 Thanks!
 
 
 
 2011/7/13 Gora Mohanty g...@mimirtech.com:
 On Wed, Jul 13, 2011 at 10:30 PM, Lucas Miguez lucas.mig...@gmail.com 
 wrote:
 Hi,
 
 is it possible to do that in Apache Solr? If i make a search, how I
 know from where it comes the result?
 [...]
 
 Your question is not very clear, and I happen unfortunately to be
 out of crystal balls and Tarot cards.
 
 Is it possible to do what? Make a search on what, and what sort
 of results do you you expect from said search?
 
 Peering into the misty depths of my non-existent crystal ball,
 if you are asking is it possible to index an XML file, search it,
 and figure out which node of the XML the search result comes
 from, yes that is possible; though details, and better advice
 would require more input from your side. Roughly speaking,
 each node can go into a separate Solr field, and full-text
 search on all relevant fields is also possible. Joking aside, please
 do provide more details.
 
 Regards,
 Gora
 







import Data via PHP

2011-07-14 Thread Jörg Agatz
hallo users...

i have a Problem..

I have ti indexin Data via PHP.. the Information for data existing... and
the Fiels too..

?php
$id = $_POST['id'];
$name = $_POST['name'];
$url = $_POST['url'];
$color = $_POST['color'];
$size = $_POST['size'];
ect...
?

fields id, name, url, color, size are existing in schema, and it work..


But how can i send it to solr, i try it with curl.. but it dosent work

curl 
http://myserver/solr/update/extract?commit=trueliteral.id=$idliteral.name=$nameliteral.url=$urlliteral.size=$sizestream.file=



RE: import Data via PHP

2011-07-14 Thread Brian Gerby

Joerg - 
In your PHP code, you can create a snippet of XML with your fields and send 
that to your solr server via a form post. Example of XML Schema here 
http://wiki.apache.org/solr/UpdateXmlMessages. 



 Date: Thu, 14 Jul 2011 20:48:20 +0200
 Subject: import Data via PHP
 From: joerg.ag...@googlemail.com
 To: solr-user@lucene.apache.org
 
 hallo users...
 
 i have a Problem..
 
 I have ti indexin Data via PHP.. the Information for data existing... and
 the Fiels too..
 
 ?php
 $id = $_POST['id'];
 $name = $_POST['name'];
 $url = $_POST['url'];
 $color = $_POST['color'];
 $size = $_POST['size'];
 ect...
 ?
 
 fields id, name, url, color, size are existing in schema, and it work..
 
 
 But how can i send it to solr, i try it with curl.. but it dosent work
 
 curl 
 http://myserver/solr/update/extract?commit=trueliteral.id=$idliteral.name=$nameliteral.url=$urlliteral.size=$sizestream.file=
 
  

RE: import Data via PHP

2011-07-14 Thread Alexander Golubowitsch

Hi Jörg,

what exactly do you mean by it doesn't work? Is there some kind of error
message?

In any case you will at least want to url_encode() the data you add into
that Curl url.
Generally:
- You can import data e.g. via a CSV file
- You can use the Solr PHP PECL extension (which offers a few classes for
accessing a Solr instance)

 

-Original Message-
From: Jörg Agatz [mailto:joerg.ag...@googlemail.com] 
Sent: Donnerstag, 14. Juli 2011 20:48
To: solr-user@lucene.apache.org
Subject: import Data via PHP

hallo users...

i have a Problem..

I have ti indexin Data via PHP.. the Information for data existing... and
the Fiels too..

?php
$id = $_POST['id'];
$name = $_POST['name'];
$url = $_POST['url'];
$color = $_POST['color'];
$size = $_POST['size'];
ect...
?

fields id, name, url, color, size are existing in schema, and it work..


But how can i send it to solr, i try it with curl.. but it dosent work

curl 
http://myserver/solr/update/extract?commit=trueliteral.id=$idliteral.name=
$nameliteral.url=$urlliteral.size=$sizestream.file=




Lazy loading of Cores

2011-07-14 Thread Anirudha Jadhav
Is this implemented ? I was just seeing the doc-wiki , was not sure if it
was up-to-date.

Are there any specific resources for someone new to start working,
contributin Solr code viz.

current architecture, steps to compile and get it to build from source.

thanks a lot

-- 
Anirudha


Solr Request Logging

2011-07-14 Thread Ben Roubicek
I am using the trunk version of solr and I am getting a ton more logging 
information than I really care to see and definitely more than 1.4, but I cant 
really see a way to change it.

A little background:
I am faceting on fields that have a very high number of distinct values and 
also returning large numbers of documents in a sharded environment.

For example:
INFO: [core1] webapp=/solr path=/select 
params={facet=trueattr_lng_rng_low.revenue__terms=a lot of distinct values 
moreParams ...}

Another example:
INFO: [core1] webapp=/solr path=/select 
params={facet=falsefacet.mincount=1ids=a lot of document idsmoreParams...}

In just a few minutes, I have racked up 10MB of log my dev environment.   Any 
ideas for a sane way of handling these messages?  I imagine its slowing down 
Solr as well.

Thanks
-Ben


How to use solr.PatternReplaceFilterFactory with ampersand in pattern

2011-07-14 Thread M Singh
Hi:

I am using the solr.PatternReplaceFilterFactory with pattern as follows to 
escape ampersand and $ signs:

filter class=solr.PatternReplaceFilterFactory pattern=()
replacement= /

I am getting error due to embedded ampersand

[Fatal Error] schema.xml:82:71: The entity name must immediately follow the '' 
in the entity reference.
Exception in thread main org.xml.sax.SAXParseException: The entity name must 
immediately follow the '' in the entity reference.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)


Is there anyway to make it work ?

Appreciate your help.  

Thanks.


Re: How to use solr.PatternReplaceFilterFactory with ampersand in pattern

2011-07-14 Thread Markus Jelsma
You're in XML so you must escape it properly with amp; etc.
 Hi:
 
 I am using the solr.PatternReplaceFilterFactory with pattern as follows to
 escape ampersand and $ signs:
 
 filter class=solr.PatternReplaceFilterFactory pattern=()
 replacement= /
 
 I am getting error due to embedded ampersand
 
 [Fatal Error] schema.xml:82:71: The entity name must immediately follow the
 '' in the entity reference.
 Exception in thread main org.xml.sax.SAXParseException: The entity name
 must immediately follow the '' in the entity reference.
 at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
 
 
 Is there anyway to make it work ?
 
 Appreciate your help.
 
 Thanks.


Re: Lazy loading of Cores

2011-07-14 Thread Shalin Shekhar Mangar
On Fri, Jul 15, 2011 at 12:33 AM, Anirudha Jadhav aniru...@nyu.edu wrote:

 Is this implemented ? I was just seeing the doc-wiki , was not sure if it
 was up-to-date.


No, this is not implemented yet.

You may want to see:
http://wiki.apache.org/solr/LotsOfCores
https://issues.apache.org/jira/browse/SOLR-880
https://issues.apache.org/jira/browse/SOLR-1028



 Are there any specific resources for someone new to start working,
 contributin Solr code viz.

 current architecture, steps to compile and get it to build from source.


The Solr wiki has a lot of useful information.

http://wiki.apache.org/solr

http://wiki.apache.org/solr/HowToContribute

-- 
Regards,
Shalin Shekhar Mangar.


Re: Why cannot I open a read-only IndexReader from TestHarness.getIndexDir() ?

2011-07-14 Thread Shalin Shekhar Mangar
On Thu, Jul 14, 2011 at 1:56 PM, Gabriele Kahlout
gabri...@mysimpatico.comwrote:

  IndexReader getReader() throws CorruptIndexException, IOException {
return IndexReader.open(FSDirectory.open(new
 File(h.getCore().getIndexDir())), true);
}

 *org.apache.lucene.index.IndexNotFoundException: no segments* file found in
 org.apache.lucene.store.NIOFSDirectory@
 /private/var/folders/54/54wUdohaH8eR-mvbJL0l2k+++TI/-Tmp-/solrtest-SolrTestCaseJ4-1310631397578/index
 lockFactory=org.apache.lucene.store.NativeFSLockFactory@62d337d3: files:
 []*
at

 org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:694)
at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:75)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:428)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:288)
at com.mysimpatico.me.indexplugins.SolrTest.getReader(SolrTest.java:43)

 I'm calling it right after a assertU(commit()) and assertQ(req(*:*),
 getNumFoundXPath(1)) which asserts a document has been indexed.


I'm not sure but the error indicates that the index does not exist. Perhaps
the path is wrong?

-- 
Regards,
Shalin Shekhar Mangar.


Re: SolrCloud Shardding

2011-07-14 Thread Shalin Shekhar Mangar
On Thu, Jul 14, 2011 at 12:29 AM, Jamie Johnson jej2...@gmail.com wrote:

 Reading the SolrCloud wiki I see that there are goals to support
 different shardding algorithms, what is currently implemented today?
 Is the shardding logic the responsibility of the application doing the
 index?


Nothing has been committed to trunk yet. So, right now, sharding is the
responsibility of the client.

You may want to follow the jira issue:
https://issues.apache.org/jira/browse/SOLR-2341

-- 
Regards,
Shalin Shekhar Mangar.


Re: deletedPkQuery fails

2011-07-14 Thread Shalin Shekhar Mangar
On Thu, Jul 14, 2011 at 1:39 AM, Elaine Li elaine.bing...@gmail.com wrote:

 Hi Folks,

 I am trying to use the deletedPkQuery to enable deltaImport to remove
 the inactive products from solr.
 I am keeping getting the syntax error saying the query syntax is not
 right. I have tried many alternatives to the following query. Although
 all of them work in the mysql prompt directly, no one works in solr
 handler. Can anyone give me some hint to debug this type of problem?
 Is there anything special about deletedPkQuery I am not aware of?

 deletedPkQuery=select p.pId as id from products p join products_large
 pl on p.pId=pl.pId where p.pId= ${dataimporter.delta.id} and
 pl.deleted='' having count(*)=0


You need to put the ${dataimporter.delta.id in quotes.

-- 
Regards,
Shalin Shekhar Mangar.


Re: Why cannot I open a read-only IndexReader from TestHarness.getIndexDir() ?

2011-07-14 Thread Gabriele Kahlout
i don't know about the path, TestHarness chose it (seems like a temporary
directory). Does this work for you?


assertU(adoc(id, 0, url, getURL(docUID), content, blah blah
blah);
assertU(commit());
assertNumFound(1); //this is a helper method of mine
IndexReader.open(FSDirectory.open(new File(h.getCore().getIndexDir())),
true); //for me it fails here. But since the document was added I suspect
this is a bug


On Thu, Jul 14, 2011 at 10:48 PM, Shalin Shekhar Mangar 
shalinman...@gmail.com wrote:

 On Thu, Jul 14, 2011 at 1:56 PM, Gabriele Kahlout
 gabri...@mysimpatico.comwrote:

   IndexReader getReader() throws CorruptIndexException, IOException {
 return IndexReader.open(FSDirectory.open(new
  File(h.getCore().getIndexDir())), true);
 }
 
  *org.apache.lucene.index.IndexNotFoundException: no segments* file found
 in
  org.apache.lucene.store.NIOFSDirectory@
 
 /private/var/folders/54/54wUdohaH8eR-mvbJL0l2k+++TI/-Tmp-/solrtest-SolrTestCaseJ4-1310631397578/index
  lockFactory=org.apache.lucene.store.NativeFSLockFactory@62d337d3: files:
  []*
 at
 
 
 org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:694)
 at
 org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:75)
 at org.apache.lucene.index.IndexReader.open(IndexReader.java:428)
 at org.apache.lucene.index.IndexReader.open(IndexReader.java:288)
 at
 com.mysimpatico.me.indexplugins.SolrTest.getReader(SolrTest.java:43)
 
  I'm calling it right after a assertU(commit()) and assertQ(req(*:*),
  getNumFoundXPath(1)) which asserts a document has been indexed.
 
 
 I'm not sure but the error indicates that the index does not exist. Perhaps
 the path is wrong?

 --
 Regards,
 Shalin Shekhar Mangar.




-- 
Regards,
K. Gabriele

--- unchanged since 20/9/10 ---
P.S. If the subject contains [LON] or the addressee acknowledges the
receipt within 48 hours then I don't resend the email.
subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧ time(x)
 Now + 48h) ⇒ ¬resend(I, this).

If an email is sent by a sender that is not a trusted contact or the email
does not contain a valid code then the email is not received. A valid code
starts with a hyphen and ends with X.
∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
L(-[a-z]+[0-9]X)).


Re: omitTermFreq only?

2011-07-14 Thread Chris Hostetter

: Sorry I should have made the objectives clear. The goal is to reduce the 
: index size by avoiding TermFrequency stored in the index (in .frq 
: segment files).

Hmmm... why?

you're talking about eliminating a single (compressed) int per term, and 
yet you want positions which take up a lot more space (at a minimum, even 
if each term only appears once in a single document, that's already as 
much space as the frequencies)

on anything except a toy index, eliminating freq while keeping positions 
(if it were possible) is unlikely to even noticably affect the index size.

what is the motivation for your objective?  

If your main motivation is to just to reduce index size, then perhaps 
tell us more about your configuration/use cases and maybe we can offer 
alternative suggestions.

http://people.apache.org/~hossman/#xyproblem
XY Problem

Your question appears to be an XY Problem ... that is: you are dealing
with X, you are assuming Y will help you, and you are asking about Y
without giving more details about the X so that we can understand the
full issue.  Perhaps the best solution doesn't involve Y at all?
See Also: http://www.perlmonks.org/index.pl?node_id=542341


-Hoss


Re: about standardAnaylzer in solr

2011-07-14 Thread Chris Hostetter

: I using solr 3.3 which in schema.xml contain this :
...
: however, when I try on /analysis.jsp, it show difference result compare to
: using Lucene.
... 
: so my question is, how to make it analysis like in Lucene ?

To be certain of the differences, you need to be more explicit about what 
your low level lucene code looks like.

My guess is that the Version param used when constructing 
StandardAnalyzer is different then the luceneMatchVersion/ in your 
solrconfig.xml (you can override this for a single analyzer using 
analyzer luceneMatchVersion=... .../)


-Hoss


Re: Why cannot I open a read-only IndexReader from TestHarness.getIndexDir() ?

2011-07-14 Thread Chris Hostetter

: return IndexReader.open(FSDirectory.open(new
: File(h.getCore().getIndexDir())), true);
: }
: 
: *org.apache.lucene.index.IndexNotFoundException: no segments* file found in

I haven't dug into it, but i seem to recall that there were some changes a 
while back to the TestHarness and solr base test classes to start using 
Randomized Directory impls that help with verifying the code on more 
varieties of platforms.  I suspect that it's also using a RAM Based 
directories, and that nothing is ever actually getting 
written to the getIndexDir() directory.

IN general, now that multiple types of IndexReader and DirectoryProvider 
factories are supported, you can't (in general) assume that 
SolrCore.getIndexDir() will actually exist (let alone be used)

As a side comment...

You seem to be going out of your way to work arround the abstraction solr 
provides, which isn't really a good idea in Solr, let alone in tests of 
solr.  I smell a probable XY problem...

http://people.apache.org/~hossman/#xyproblem

...can you explain what your *goal* is (indepentent of the approach you 
are taking to do it), and then maybe folks can make better suggestions 
about a better approach?



-Hoss


Re: Lockfactory indicated by ../solr/admin/cores different from the setting in solrconfig.xml

2011-07-14 Thread Chris Hostetter

: We have set locktype to simple in solrconfig.xml using:
: lockTypesimple/lockType. However on the page
: localhost:8983/solr/admin/cores shows:
: str name=directory
: 
org.apache.lucene.store.MMapDirectory:org.apache.lucene.store.MMapDirectory/solr-cores/core0/data/index
: lockFactory=*org.apache.lucene.store.NativeFSLockFactory*@3415ddf5
: /str
: I can see a write.lock file in the index directory. But shouldn't the page
: solr/admin/cores also be showing the the lockFactory to be
: org.apache.lucene.store.SimpleFSLockFactory.SimpleFSLockFactory

Good question.

I think what's happening here is that the CoreAdmin page (as well as the 
Stats page fo the Core) are displaying the Directory.toString() info for 
the Directory in use by the IndexReader.  Solr doesn't seem to be 
applying the lockType/ setting to the directory used by the 
IndexReaders.

the lockType/ setting exists for the IndexWriter (to manage the write 
lock) and i *think* the IndexReader's in use in solr are al read only, so 
i'm pretty sure this isn't a majorly serious bug -- but it definitely 
smells like a bug one way or another...

https://issues.apache.org/jira/browse/SOLR-2654

-Hoss


Re: deletedPkQuery fails

2011-07-14 Thread Elaine Li
I tried putting single quote like following, it does not work.
deletedPkQuery=select p.pId as id from products p join products_large
pl on p.pId=pl.pId where p.pId= '${dataimporter.delta.id}' and
pl.deleted='' having count(*)=0

I don't have quotes in where p.pId =${dataimporter.delta.id} for my
deltaImportQuery and there is no problem there.
The pId is a INT in my db. Why do i need to put quotes around it? Is this a
special requirement for deletedPkQuery?

Thanks.

Elaine

On Thu, Jul 14, 2011 at 4:53 PM, Shalin Shekhar Mangar 
shalinman...@gmail.com wrote:
 On Thu, Jul 14, 2011 at 1:39 AM, Elaine Li elaine.bing...@gmail.com
wrote:

 Hi Folks,

 I am trying to use the deletedPkQuery to enable deltaImport to remove
 the inactive products from solr.
 I am keeping getting the syntax error saying the query syntax is not
 right. I have tried many alternatives to the following query. Although
 all of them work in the mysql prompt directly, no one works in solr
 handler. Can anyone give me some hint to debug this type of problem?
 Is there anything special about deletedPkQuery I am not aware of?

 deletedPkQuery=select p.pId as id from products p join products_large
 pl on p.pId=pl.pId where p.pId= ${dataimporter.delta.id} and
 pl.deleted='' having count(*)=0


 You need to put the ${dataimporter.delta.id in quotes.

 --
 Regards,
 Shalin Shekhar Mangar.



Re: How to create a solr core if no solr cores were created before?

2011-07-14 Thread Chris Hostetter

you need to give us some more info in order to give you meaningful 
assistance..

1) what does your solr.xml look like?
2) what files/directories are in pathToSolrHome?
3) what is the full stack trace?


: Hi,
: 
: I tried to create a solr core but I always get No such solr core:-Exception.
: 
: -
: File home = new File( pathToSolrHome );
: File f = new File( home, solr.xml );
: 
: CoreContainer coreContainer = new CoreContainer();
: coreContainer.load( pathToSolrHome, f );
: 
: EmbeddedSolrServer server = new EmbeddedSolrServer(coreContainer, );
: CoreAdminRequest.createCore(coreName, coreDir, server);
: -
: 
: I think the problem is the  in new EmbeddedSolrServer(coreContainer, );
: 
: Thanks.
: 

-Hoss