Customer query operator in solr

2013-11-09 Thread lampa24
I use solr 4.5.1

My data structure contains records and subrecords. Every record is
constructed from subrecords. Exist a lot of kind of subrecords. Exemple in
XML :

 doc
  recordId10/recordId
  subRecordId11/subRecordId
  SR1.FirstNameKris/SR1.FirstName//SR1 is name
  SR1.LastNameJenner/SR1.LastName
  SR1.MaidenNameKardashian/SR1.MaidenName
 doc

 doc
  recordId10/recordId
  subRecordId12/subRecordId
  SR5.CountryUSA/SR1.Country
  SR5.CityLos-Angeles/SR1.City//SR5 is address
  SR5.Street125 street/SR1.Street
  SR5.Zip98532/SR1.Zip
 doc

 doc
  recordId10/recordId
  subRecordId13/subRecordId
  SR5.CountryAustralia/SR1.Country//SR5 is address
  SR5.CityCanberra/SR1.City
  SR5.Street278 avenue/SR1.Street
  SR5.Zip7511/SR1.Zip
 doc
In the example: I have two kinds of subrecords: Name and Address. They
belong to record 10.

I need to built query about name and address ,when name and address belong
to same record . q=SR5.Zip:7511 MyAnd SR1.FirstName:Kris

When the operator MyAnd merge the results by Record Id.

May be , Have solr operator like this ?

Can I add my own operator?

TNX



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Customer-query-operator-in-solr-tp4100079.html
Sent from the Solr - User mailing list archive at Nabble.com.


HierarchicalFaceting for Ecommerce Categories

2013-11-09 Thread Nea
Hi Everybody,

I’m using Solr 4.5.1 and I need to achieve a HierarchicalFaceting for leveled 
categories. Someone can explain me how schema.xml and query should be?


My category path is;

Cameras  Camcorders[  5 
items]
Cameras  Digital Cameras
Cameras  Digital Cameras  Digital SLR [15 items]
Cameras  Digital Cameras  Mirrorless Cameras  [  4 items]


And i want to facet as;

first query:
cameras (24)

second level query
camorders (5)
digital cameras (19)

third level facet query for digital cameras
digital slr (15)
mirrorless (4)


ty.




Re: HierarchicalFaceting for Ecommerce Categories

2013-11-09 Thread Upayavira
http://wiki.apache.org/solr/HierarchicalFaceting

Upayavira

On Sat, Nov 9, 2013, at 12:09 PM, Nea wrote:
 Hi Everybody,
 
 I’m using Solr 4.5.1 and I need to achieve a HierarchicalFaceting for
 leveled categories. Someone can explain me how schema.xml and query
 should be?
 
 
 My category path is;
 
 Cameras  Camcorders[
  5 items]
 Cameras  Digital Cameras
 Cameras  Digital Cameras  Digital SLR [15 items]
 Cameras  Digital Cameras  Mirrorless Cameras  [  4 items]
 
 
 And i want to facet as;
 
 first query:
   cameras (24)
 
 second level query
   camorders (5)
   digital cameras (19)
 
 third level facet query for digital cameras
   digital slr (15)
   mirrorless (4)
 
 
 ty.
 
 


Re: character encoding issue...

2013-11-09 Thread Chris
I tried a lot of things and almost am at my wit's end :(


Here is the code I used to get the strings -

String htmlContent = readPage(page.getWebURL().getURL());

I even tried -
Document doc = Jsoup.parse(new URL(url).openStream(), UTF-8, url);
String htmlContent = doc.html();

 Document doc = Jsoup.parse(htmlContent,UTF-8);

No improvement so far, any advice for me please?



function that gets the html 
 public static String readPage(String urlString)  {
 try{

   URL url = new URL(urlString);
 DefaultHttpClient client = new DefaultHttpClient();
 client.getParams().setParameter(ClientPNames.COOKIE_POLICY,
 CookiePolicy.BROWSER_COMPATIBILITY);

 HttpGet request = new HttpGet(url.toURI());
 HttpResponse response = client.execute(request);

 if(response.getStatusLine().getStatusCode() == 200 
response.getEntity().getContentType().toString().contains(text/html))
 {
 Reader reader = null;
 try {
 reader = new
InputStreamReader(response.getEntity().getContent());

 StringBuffer sb = new StringBuffer();
 {
 int read;
 char[] cbuf = new char[1024];
 while ((read = reader.read(cbuf)) != -1)
 sb.append(cbuf, 0, read);
 }

 return sb.toString();

 } finally {
 if (reader != null) {
 try {
 reader.close();
 } catch (IOException e) {
 e.printStackTrace();
 }
}
 }
 }
 else
 return ;

 }catch(Exception e){return ;}

 }

---



On Wed, Nov 6, 2013 at 2:53 AM, T. Kuro Kurosaka k...@healthline.comwrote:

 It sounds like the characters were mishandled at index build time.
 I would use Luke to see if a character that appear correctly
 when you change the output to be SHIFT JIS is actually
 stored as one Unicode. I bet it's stored as two characters,
 each having the character of the value that happened
 to be high and low bytes of the SHIFT JIS character.

 There are many possible cause of this. If you are indexing
 the HTML document from HTTP servers, HTTP server may
 be configured to send wrong charset= info in Content-Type
 header. If the document is directly from a file system,
 and if the document doesn't  have META header declaring
 the charset, then the system assumes a default charset,
 which is typically ISO-8859-1 or UTF-8, and misinterprets
 SHIF-JIS encoded characters.

 You need to debug to find out where the characters
 get corrupted.


 On 11/04/2013 11:15 PM, Chris wrote:

 Sorry, was away a bit  hence the delay.

 I am inserting java strings into a java bean class, and then doing a
 addBean() method to insert the POJO into Solr.

 When i Query using either tomcat/jetty, I get these special characters.
 But
 I have noted, if I change output to - Shift-JIS encoding then those
 characters appear as some japanese characters I think.

 But then this solution doesn't work for all special characters as I can
 still see some of them...isn't there an encoding that can cover all the
 characters whatever they might be? Any ideas on what do i do?

 Regards,
 Chris


 On Mon, Nov 4, 2013 at 6:27 PM, Erick Erickson erickerick...@gmail.com
 wrote:

  The problem is there are about a dozen places where the character
 encoding can be mis-configured. The problem you're seeing above
 actually looks like a problem with the character set configured in
 your browser, it may have nothing to do with what's actually in Solr.

 You might write small SolrJ program and see if you can dump the contents
 in binary and examine to see...

 Best
 Erick


 On Sun, Nov 3, 2013 at 6:39 AM, Rajani Maski rajinima...@gmail.com
 wrote:

  How are you extracting the text that is there in the website[1] you are
 referring to? Apache Nutch or any other crawler? If yes, initially check
 whether that crawler engine is giving you data in correct format before

 you

 invoke solr index method.

 [1]http://blog.diigo.com/2009/09/28/scheduled-groups-maintenance/

 URI encoding should resolve this problem.




 On Fri, Nov 1, 2013 at 10:50 AM, Chris christu...@gmail.com wrote:

  Hi Rajani,

 I followed the steps exactly as in


  http://zensarteam.wordpress.com/2011/11/25/6-steps-to-
 configure-solr-on-apache-tomcat-7-0-20/

 However, when i send a query to this new instance in tomcat, i again

 get

 the error -

str name=fulltxtScheduled Groups Maintenance
 In preparation for the new release roll-out, Diigo groups won’t be
 accessible 

Re: core swap duplicates core entries in solr.xml

2013-11-09 Thread Alan Woodward
Hi Jeremy,

Could you open a JIRA ticket for this?

Thanks,

Alan Woodward
www.flax.co.uk


On 8 Nov 2013, at 21:16, Branham, Jeremy [HR] wrote:

 When performing  a core swap in SOLR 4.5.1 with persistence on, the two core 
 entries that were swapped are duplicated.
 
 Solr.xml
 
 ?xml version=1.0 encoding=UTF-8 ?
 solr persistent=true sharedLib=lib
  cores adminPath=/admin/cores
core schema=/data/v8p/solr/root/conf/schema.xml 
 instanceDir=/data/v8p/solr/root/ name=howtopolicies 
 dataDir=/data/v8p/solr/howtopolicies/data/
core schema=/data/v8p/solr/root/conf/schema.xml 
 instanceDir=/data/v8p/solr/root/ name=wdsc 
 dataDir=/data/v8p/solr/wdsc/data/
core schema=/data/v8p/solr/root/conf/schema.xml 
 instanceDir=/data/v8p/solr/root/ name=other 
 dataDir=/data/v8p/solr/other/data/
core schema=/data/v8p/solr/root/conf/schema.xml 
 instanceDir=/data/v8p/solr/root/ name=psd 
 dataDir=/data/v8p/solr/psd/data/
core schema=/data/v8p/solr/root/conf/schema.xml 
 instanceDir=/data/v8p/solr/root/ name=nat 
 dataDir=/data/v8p/solr/nat/data/
core schema=/data/v8p/solr/root/conf/schema.xml 
 instanceDir=/data/v8p/solr/root/ name=wdsc2 
 dataDir=/data/v8p/solr/wdsc2/data/
core schema=/data/v8p/solr/root/conf/schema.xml 
 instanceDir=/data/v8p/solr/root/ name=kms2 
 dataDir=/data/v8p/solr/kms/data/
core schema=/data/v8p/solr/root/conf/schema.xml 
 instanceDir=/data/v8p/solr/root/ name=howtotools 
 dataDir=/data/v8p/solr/howtotools/data/
core schema=/data/v8p/solr/root/conf/schema.xml 
 instanceDir=/data/v8p/solr/root/ name=ewts 
 dataDir=/data/v8p/solr/ewts/data/
core schema=/data/v8p/solr/root/conf/schema.xml 
 instanceDir=/data/v8p/solr/root/ name=wdsr 
 dataDir=/data/v8p/solr/wdsr/data/
core schema=/data/v8p/solr/root/conf/schema.xml 
 instanceDir=/data/v8p/solr/root/ name=wdsr2 
 dataDir=/data/v8p/solr/wdsr2/data/
core schema=/data/v8p/solr/root/conf/schema.xml 
 instanceDir=/data/v8p/solr/root/ name=ce 
 dataDir=/data/v8p/solr/ce/data/
core schema=/data/v8p/solr/root/conf/schema.xml 
 instanceDir=/data/v8p/solr/root/ name=sp2 
 dataDir=/data/v8p/solr/sp2/data/
core schema=/data/v8p/solr/root/conf/schema.xml 
 instanceDir=/data/v8p/solr/root/ name=terms 
 dataDir=/data/v8p/solr/terms/data/
core schema=/data/v8p/solr/root/conf/schema.xml 
 instanceDir=/data/v8p/solr/root/ name=tools 
 dataDir=/data/v8p/solr/tools/data/
core schema=/data/v8p/solr/root/conf/schema.xml 
 instanceDir=/data/v8p/solr/root/ name=kms 
 dataDir=/data/v8p/solr/kms2/data/
core schema=/data/v8p/solr/root/conf/schema.xml 
 instanceDir=/data/v8p/solr/root/ name=wdsp 
 dataDir=/data/v8p/solr/wdsp2/data/
core schema=/data/v8p/solr/root/conf/schema.xml 
 instanceDir=/data/v8p/solr/root/ name=wdsp2 
 dataDir=/data/v8p/solr/wdsp/data/
  /cores
 /solr
 
 
 Performed swap -
 
 ?xml version=1.0 encoding=UTF-8 ?
 solr persistent=true sharedLib=lib
  cores adminPath=/admin/cores
core name=ce instanceDir=/data/v8p/solr/root/ 
 schema=/data/v8p/solr/root/conf/schema.xml 
 dataDir=/data/v8p/solr/ce/data/
core name=ewts instanceDir=/data/v8p/solr/root/ 
 schema=/data/v8p/solr/root/conf/schema.xml 
 dataDir=/data/v8p/solr/ewts/data/
core name=howtopolicies instanceDir=/data/v8p/solr/root/ 
 schema=/data/v8p/solr/root/conf/schema.xml 
 dataDir=/data/v8p/solr/howtopolicies/data/
core name=howtotools instanceDir=/data/v8p/solr/root/ 
 schema=/data/v8p/solr/root/conf/schema.xml 
 dataDir=/data/v8p/solr/howtotools/data/
core name=kms instanceDir=/data/v8p/solr/root/ 
 schema=/data/v8p/solr/root/conf/schema.xml 
 dataDir=/data/v8p/solr/kms/data/
core name=kms2 instanceDir=/data/v8p/solr/root/ 
 schema=/data/v8p/solr/root/conf/schema.xml 
 dataDir=/data/v8p/solr/kms2/data/
core name=nat instanceDir=/data/v8p/solr/root/ 
 schema=/data/v8p/solr/root/conf/schema.xml 
 dataDir=/data/v8p/solr/nat/data/
core name=other instanceDir=/data/v8p/solr/root/ 
 schema=/data/v8p/solr/root/conf/schema.xml 
 dataDir=/data/v8p/solr/other/data/
core name=psd instanceDir=/data/v8p/solr/root/ 
 schema=/data/v8p/solr/root/conf/schema.xml 
 dataDir=/data/v8p/solr/psd/data/
core name=sp2 instanceDir=/data/v8p/solr/root/ 
 schema=/data/v8p/solr/root/conf/schema.xml 
 dataDir=/data/v8p/solr/sp2/data/
core name=terms instanceDir=/data/v8p/solr/root/ 
 schema=/data/v8p/solr/root/conf/schema.xml 
 dataDir=/data/v8p/solr/terms/data/
core name=tools instanceDir=/data/v8p/solr/root/ 
 schema=/data/v8p/solr/root/conf/schema.xml 
 dataDir=/data/v8p/solr/tools/data/
core name=wdsc instanceDir=/data/v8p/solr/root/ 
 schema=/data/v8p/solr/root/conf/schema.xml 
 dataDir=/data/v8p/solr/wdsc/data/
core name=wdsc2 instanceDir=/data/v8p/solr/root/ 
 schema=/data/v8p/solr/root/conf/schema.xml 
 dataDir=/data/v8p/solr/wdsc2/data/
core name=wdsp instanceDir=/data/v8p/solr/root/ 
 schema=/data/v8p/solr/root/conf/schema.xml 
 dataDir=/data/v8p/solr/wdsp2/data/
core name=wdsp2 

Re: HierarchicalFaceting for Ecommerce Categories

2013-11-09 Thread Nea
HierarchicalFaceting documentation does not clearly explain how to index and 
query field types descendent_path and ancestor_path” included in schema.xml. 

Any help would be greatly appreciated.


!-- 
  Example of using PathHierarchyTokenizerFactory at index time, so
  queries for paths match documents at that path, or in descendent paths
—

fieldType name=descendent_path class=solr.TextField
  analyzer type=index
tokenizer class=solr.PathHierarchyTokenizerFactory delimiter=/ /
  /analyzer
  analyzer type=query
tokenizer class=solr.KeywordTokenizerFactory /
  /analyzer
/fieldType

!-- 
  Example of using PathHierarchyTokenizerFactory at query time, so
  queries for paths match documents at that path, or in ancestor paths
—

fieldType name=ancestor_path class=solr.TextField
  analyzer type=index
tokenizer class=solr.KeywordTokenizerFactory /
  /analyzer
  analyzer type=query
tokenizer class=solr.PathHierarchyTokenizerFactory delimiter=/ /
  /analyzer
/fieldType


On Nov 9, 2013, at 15:22, Upayavira u...@odoko.co.uk wrote:

 http://wiki.apache.org/solr/HierarchicalFaceting
 
 Upayavira
 
 On Sat, Nov 9, 2013, at 12:09 PM, Nea wrote:
 Hi Everybody,
 
 I’m using Solr 4.5.1 and I need to achieve a HierarchicalFaceting for
 leveled categories. Someone can explain me how schema.xml and query
 should be?
 
 
 My category path is;
 
 Cameras  Camcorders[
 5 items]
 Cameras  Digital Cameras
 Cameras  Digital Cameras  Digital SLR [15 items]
 Cameras  Digital Cameras  Mirrorless Cameras  [  4 items]
 
 
 And i want to facet as;
 
 first query:
  cameras (24)
 
 second level query
  camorders (5)
  digital cameras (19)
 
 third level facet query for digital cameras
  digital slr (15)
  mirrorless (4)
 
 
 ty.
 
 



Re: Merging shards and replicating changes in SolrCloud

2013-11-09 Thread Shalin Shekhar Mangar
Comments inline:

On Fri, Nov 8, 2013 at 8:09 PM, michael.boom my_sky...@yahoo.com wrote:

 Here's the background of this topic:
 I have setup a collection with 4 shards, replicationFactor=2, on two
 machines.
 I started to index documents, but after hitting some update deadlocks and
 restarting servers my shards ranges in ZK state got nulled (i'm using
 implicit routing). Indexing continued without me noticing and all new
 documents were indexed in shard1 creating huge disproportions with
 shards2,3,4.
 Of course, I want to fix this and get my index into 4 shards, evenly
 distributed.


If you are using implicit routing then the shard ranges should be null.
Shard ranges are only used when the router is compositeId.



 What I'm thinking to do is:
 1. on machine 1, merge shards2,3,4 into shard1 using
 http://wiki.apache.org/solr/MergingSolrIndexes
 (at this point what happens to the replica of shard1 on machine2 ? will
 SolrCloud try to replicate shard1 from machine1?)


Index merge is a core admin command. It is not solr cloud aware. Therefore
I think that merging will not automatically replicate shard1 on machine1 to
other replicas unless a recovery is requested for some reason.


 2. on machine 2, unload the shard1,2,3,4 cores
 3. on machine 1, split shard1 in shard1_0 and shard1_1. Again split
 shard1_0
 and 1_1 getting 4 equal shards 1_0_0, 1_0_1, 1_1_0, 1_1_1
 (will now the shard range for the newborns be correct if in the beginning
 shard1's range was null?)


No, shard splitting does not work with implicit routing. It works only if
router is compositeId.


 4. on machine 1 unload shard1
 5. rename shards 1_0_0, 1_0_1, 1_1_0, 1_1_1 to 1,2,3,4.
 6. replicate shard 1,2,3,4 to machine 2

 Do you see any problems with this scenario? Anything that could be don in a
 more efficient way ?
 Thank you



Unfortunately no. If you had only inserts on your index and you were
searching across the entire cluster always i.e. you don't care where a
document ends up -- then you could have used the core admin split API to
re-balance the cluster. I think you should just re-index everything and
start again.



 -
 Thanks,
 Michael
 --
 View this message in context:
 http://lucene.472066.n3.nabble.com/Merging-shards-and-replicating-changes-in-SolrCloud-tp407.html
 Sent from the Solr - User mailing list archive at Nabble.com.




-- 
Regards,
Shalin Shekhar Mangar.


Re: Solr grouping performance porblem

2013-11-09 Thread Joel Bernstein
Shamik,

The CollapsingQParserPlugin will be available in Solr 4.6 and it should
perform much better when collapsing on a high cardinality field. The 4.6
code doesn't directly port back to Solr 4.4 though due to some changes in
the build for 4.6. The jira ticket has a conversation about this though and
you may be able to follow it and create a patch for 4.4.

Joel


On Thu, Oct 31, 2013 at 1:37 AM, Shamik Bandopadhyay sham...@gmail.comwrote:

 Hi,

I've recently upgraded to SolrCloud (4.4) from Master-Slave mode. One of
 the changes I did the in queries is to add group functionality to remove
 duplicate results. The grouping is done on a specific field. But the change
 seemed to have a huge effect on the query performance. The group option
 decreased the performance by 10 times. For e.g. this query takes 1 sec to
 execute. The number of results is around 105387.


 http://localhost:8083/solr/browse?fq=language:(english)wt=xmlrows=10start=0fq=(ContentGroup-local
 :Learn
  Explore OR ADSKContentGroup-local:Getting Started)q=linesort=score
 descgroup=truegroup.field=dedupgroup.ngroups=true

 If I exclude group option, it comes down to 190ms


 http://localhost:8083/solr/browse?fq=language:(english)wt=xmlrows=10start=0fq=(ContentGroup-local
 :Learn
  Explore OR ADSKContentGroup-local:Getting Started)q=line

 I'm running this query against a 8 million doc index . I've 2 shard with 1
 replica each, running on a m1x.large EC2 instance, each having 8gb allocat
 ed memory.

 Is this a known issue or am I missing something which is making this query
 expensive.

 I bumped into this JIRA --
 https://issues.apache.org/jira/browse/SOLR-5027 which
 talks about CollapsingQParserPlugin as an alternate to grouping, but that
 seemed to be available in 4.6. Just wondering if it can be an alternate in
 my case and whether if its possible to apply as a patch in 4.4 version.

 Any pointer will be appreciated.

 - Thanks,
 Shamik




-- 
Joel Bernstein
Search Engineer at Heliosearch


Re: HierarchicalFaceting for Ecommerce Categories

2013-11-09 Thread Upayavira
You want to use descendent_path. If you have a delimiter of /, then:

  books/it/programming/java 

would become:

  books 
  books/IT
  books/IT/programming
  books/IT/programming/java

Meaning you can facet on this field. If you wish to get a specific level
only, then you need to either do your own splitting, or extend the
PathHierarchyTokenizerFactory to be able to do it like this:

  1:books 
  2:books/IT
  3:books/IT/programming
  4:books/IT/programming/java

Then, you can use facet.prefix to search for a specific level in the
hierarchy. Fixing the PathHierarchyTokenizer would be great for all of
us.

Upayavira

On Sat, Nov 9, 2013, at 03:19 PM, Nea wrote:
 HierarchicalFaceting documentation does not clearly explain how to index
 and query field types descendent_path and ancestor_path” included in
 schema.xml. 
 
 Any help would be greatly appreciated.
 
 
 !-- 
   Example of using PathHierarchyTokenizerFactory at index time, so
   queries for paths match documents at that path, or in descendent
   paths
 —
 
 fieldType name=descendent_path class=solr.TextField
   analyzer type=index
   tokenizer class=solr.PathHierarchyTokenizerFactory delimiter=/ /
   /analyzer
   analyzer type=query
   tokenizer class=solr.KeywordTokenizerFactory /
   /analyzer
 /fieldType
 
 !-- 
   Example of using PathHierarchyTokenizerFactory at query time, so
   queries for paths match documents at that path, or in ancestor
   paths
 —
 
 fieldType name=ancestor_path class=solr.TextField
   analyzer type=index
   tokenizer class=solr.KeywordTokenizerFactory /
   /analyzer
   analyzer type=query
   tokenizer class=solr.PathHierarchyTokenizerFactory delimiter=/ /
   /analyzer
 /fieldType
 
 
 On Nov 9, 2013, at 15:22, Upayavira u...@odoko.co.uk wrote:
 
  http://wiki.apache.org/solr/HierarchicalFaceting
  
  Upayavira
  
  On Sat, Nov 9, 2013, at 12:09 PM, Nea wrote:
  Hi Everybody,
  
  I’m using Solr 4.5.1 and I need to achieve a HierarchicalFaceting for
  leveled categories. Someone can explain me how schema.xml and query
  should be?
  
  
  My category path is;
  
  Cameras  Camcorders[
  5 items]
  Cameras  Digital Cameras
  Cameras  Digital Cameras  Digital SLR [15 items]
  Cameras  Digital Cameras  Mirrorless Cameras  [  4 items]
  
  
  And i want to facet as;
  
  first query:
 cameras (24)
  
  second level query
 camorders (5)
 digital cameras (19)
  
  third level facet query for digital cameras
 digital slr (15)
 mirrorless (4)
  
  
  ty.
  
  
 


Re: HierarchicalFaceting for Ecommerce Categories

2013-11-09 Thread Nea
Thanks for ur reply. I got it.

My old implementation on solr 3.1 was multivalued string field with 1_catL1, 
2_catL2, and doing it with prefix and tagging.
I thought at 4.5.1, can be a nice way doing it :(


On Nov 9, 2013, at 20:10, Upayavira u...@odoko.co.uk wrote:

 You want to use descendent_path. If you have a delimiter of /, then:
 
  books/it/programming/java 
 
 would become:
 
  books 
  books/IT
  books/IT/programming
  books/IT/programming/java
 
 Meaning you can facet on this field. If you wish to get a specific level
 only, then you need to either do your own splitting, or extend the
 PathHierarchyTokenizerFactory to be able to do it like this:
 
  1:books 
  2:books/IT
  3:books/IT/programming
  4:books/IT/programming/java
 
 Then, you can use facet.prefix to search for a specific level in the
 hierarchy. Fixing the PathHierarchyTokenizer would be great for all of
 us.
 
 Upayavira
 
 On Sat, Nov 9, 2013, at 03:19 PM, Nea wrote:
 HierarchicalFaceting documentation does not clearly explain how to index
 and query field types descendent_path and ancestor_path” included in
 schema.xml. 
 
 Any help would be greatly appreciated.
 
 
!-- 
  Example of using PathHierarchyTokenizerFactory at index time, so
  queries for paths match documents at that path, or in descendent
  paths
—
 
fieldType name=descendent_path class=solr.TextField
  analyzer type=index
  tokenizer class=solr.PathHierarchyTokenizerFactory delimiter=/ /
  /analyzer
  analyzer type=query
  tokenizer class=solr.KeywordTokenizerFactory /
  /analyzer
/fieldType
 
!-- 
  Example of using PathHierarchyTokenizerFactory at query time, so
  queries for paths match documents at that path, or in ancestor
  paths
—
 
fieldType name=ancestor_path class=solr.TextField
  analyzer type=index
  tokenizer class=solr.KeywordTokenizerFactory /
  /analyzer
  analyzer type=query
  tokenizer class=solr.PathHierarchyTokenizerFactory delimiter=/ /
  /analyzer
/fieldType
 
 
 On Nov 9, 2013, at 15:22, Upayavira u...@odoko.co.uk wrote:
 
 http://wiki.apache.org/solr/HierarchicalFaceting
 
 Upayavira
 
 On Sat, Nov 9, 2013, at 12:09 PM, Nea wrote:
 Hi Everybody,
 
 I’m using Solr 4.5.1 and I need to achieve a HierarchicalFaceting for
 leveled categories. Someone can explain me how schema.xml and query
 should be?
 
 
 My category path is;
 
 Cameras  Camcorders[
 5 items]
 Cameras  Digital Cameras
 Cameras  Digital Cameras  Digital SLR [15 items]
 Cameras  Digital Cameras  Mirrorless Cameras  [  4 items]
 
 
 And i want to facet as;
 
 first query:
cameras (24)
 
 second level query
camorders (5)
digital cameras (19)
 
 third level facet query for digital cameras
digital slr (15)
mirrorless (4)
 
 
 ty.
 
 
 



count links pointing to id

2013-11-09 Thread Andreas Owen
I have a multivalue field with links pointing to ids of solrdocuments. I
would like calculate how many links are pointing to each document und put
that number into the field links2me. How can I do this, I would prefer to do
it with a query and the updater so solr can do it internaly if possible?



new collection clustering class not found.

2013-11-09 Thread mike st. john
I have a cluster with several collections using the same config in zk,
when i add a new collection through the collection api it
throws org.apache.solr.common.SolrException: Error loading class
'solr.clustering.ClusteringComponent'


when i query all the other collections, clustering works fine,  in the solr
logs i can see the other collections are loading up the clustering libs.

I've tried adding the libs to the sharedlib, but thats causing other issues.


anyone see anything similar with solr 4.4.0?

thanks

msj


Re: new collection clustering class not found.

2013-11-09 Thread Shawn Heisey
On 11/9/2013 6:26 PM, mike st. john wrote:
 I have a cluster with several collections using the same config in zk,
 when i add a new collection through the collection api it
 throws org.apache.solr.common.SolrException: Error loading class
 'solr.clustering.ClusteringComponent'
 
 
 when i query all the other collections, clustering works fine,  in the solr
 logs i can see the other collections are loading up the clustering libs.
 
 I've tried adding the libs to the sharedlib, but thats causing other issues.

You could be running into this:

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

Basically what you need to do to eliminate this problem is remove the
sharedLib attribute from solr.xml and put all your extra jars in
${solr.solr.home}/lib, which is automatically searched regardless of
configuration.

You should also remove all lib directives from your solrconfig.xml
file(s).

Thanks,
Shawn



Query Relevancy tuning...

2013-11-09 Thread Chris
  Hi Gurus,

I have a relevancy ranking questrion -

1. I have fields - title, domain, domainrank in index.
2. I am looking to maybe load a txt file of prefered domains at solr
startup  boost documents from those domains if keyword matches text in
title or domain (if it exactly matches the domain, it should rank higher,
than if it were a semi match)
3. Also, i would like to have 2-3 results per domain per page.(at the max)
4. Also, is it possible to do intersection - if all 4 words(say) matches it
should rank higher than maybe 3 word match  so on..

I would like this to be as fast as possible, so kindly suggest an optimal
way of doing this.

a few things that were tried

str name=defTypeedismax/str
   str name=qf
  fulltxt^0.5 title^2.0 domain^3 urlKeywords^1.5 anchorText^2.0
h1Keywords^1.5
   /str
   str name=dftext/str
   str name=mm100%/str
   str name=q.alt*:*/str
   str name=rows10/str
   str name=fl*,score/str