solr,faceted-search,hierarchical , Hierarchical faceted search example with Solr


Hierarchical faceted search example with Solr

Question:

Tag: solr,faceted-search,hierarchical

Question

Where can I find a complete example that shows how hierarchical faceted search works from indexing the documents to retrieving search results?

My research so far

Stackoverflow has a few posts, but all of them only address certain aspects of hierarchical faceted search; therefore, I wouldn't consider them to be duplicates. I'm looking for a complete example to understand it. I keep missing the last query where the aggregations work.

There is documentation on the Solr webpage, but didn't understand the example given there.

Example (conceptually)

I'd like to create a complete walkthrough example here and hope you can provide the missing final piece.

Testdata

Input

Let's say we have 3 documents with each document being a person.

Alice (document 1)
 - Blond
 - Europe

Jane (document 2)
 - Brown
 - Europe/Norway

Bob (document 3)
 - Brown
 - Europe/Norway
 - Europe/Sweden

Output

The expected output for this (currently wrong) query

http://server:8983/solr/my_core/select?q=*%3A*&wt=json&indent=true&facet=true&facet.field=tags_ss

should be

Hair_color (3)
- blond (1)
- brown (1)
- black (1)

Location (3)
- Europe (4)  // This should be 4 not 3, i.e. the sum of the leaves, because Alice is tagged with "Europe" only, without a country
  - Norway (2)
  - Sweden (1)

because all documents are found.

Example (programmatically)

This is where I require help. How do I implement the above conceptual example?

Here is how far I've gotten.

1. Create the test data XML

This is the content of the documents.xml file in the solr-5.1.0/testdata subfolder:

<add>
    <doc>
        <field name="id">Alice</field>
        <field name="tags_ss">hair_color/blond</field>
        <field name="tags_ss">location/Europe</field>
    </doc>
    <doc>
        <field name="id">Jane</field>
        <field name="tags_ss">hair_color/brown</field>
        <field name="tags_ss">location/Europe/Norway</field>
    </doc>
    <doc>
        <field name="id">Bob</field>
        <field name="tags_ss">hair_color/black</field>
        <field name="tags_ss">location/Europe/Norway</field>
        <field name="tags_ss">location/Europe/Sweden</field>
    </doc>
</add>

The _ss is defined in schema.xml as

<dynamicField name="*_ss" type="string"  indexed="true"  stored="true" multiValued="true"/>

Note that all tags, e.g. hair_color and location and anything tags that will be added in the future, are stored in the same tags_ss field.

2. Index the test data with Solr

c:\solr-5.1.0>java -classpath dist/solr-core-5.1.0.jar -Dauto=yes -Dc=gettingstarted -Ddata=files -Drecursive=yes -Durl=http://server:8983/solr/my_core/update org.apache.solr.util.SimplePostTool .\testdata

Solr statistics page

3. Retrieve all data with a Solr query (without faceting)

Query

http://server:8983/solr/my_core/select?q=*%3A*&wt=json&indent=true

Result

{
  "responseHeader": {
    "status": 0,
    "QTime": 0,
    "params": {
      "indent": "true",
      "q": "*:*",
      "_": "1430830360536",
      "wt": "json"
    }
  },
  "response": {
    "numFound": 3,
    "start": 0,
    "docs": [
      {
        "id": "Alice",
        "tags_ss": [
          "hair_color/blond",
          "location/europe"
        ],
        "_version_": 1500334369469890600
      },
      {
        "id": "Jane",
        "tags_ss": [
          "hair_color/brown",
          "location/europe/Norway"
        ],
        "_version_": 1500334369469890600
      },
      {
        "id": "Bob",
        "tags_ss": [
          "hair_color/black",
          "location/europe/Norway",
          "location/europe/Sweden"
        ],
        "_version_": 1500334369469890600
      }
    ]
  }
}

4. Retrieve all data with a Solr query (with faceting)

Query

http://server:8983/solr/my_core/select?q=*%3A*&wt=json&indent=true&facet=true&facet.field=tags_ss

Result

{
  "responseHeader": {
    "status": 0,
    "QTime": 0,
    "params": {
      "facet": "true",
      "indent": "true",
      "q": "*:*",
      "_": "1430830432389",
      "facet.field": "tags_ss",
      "wt": "json"
    }
  },
  "response": {
    "numFound": 3,
    "start": 0,
    "docs": [
      {
        "id": "Alice",
        "tags_ss": [
          "hair_color/blond",
          "location/europe"
        ],
        "_version_": 1500334369469890600
      },
      {
        "id": "Jane",
        "tags_ss": [
          "hair_color/brown",
          "location/europe/Norway"
        ],
        "_version_": 1500334369469890600
      },
      {
        "id": "Bob",
        "tags_ss": [
          "hair_color/black",
          "location/europe/Norway",
          "location/europe/Sweden"
        ],
        "_version_": 1500334369469890600
      }
    ]
  },
  "facet_counts": {
    "facet_queries": {},
    "facet_fields": {
      "tags_ss": [
        "location/europe/Norway",
        2,
        "hair_color/black",
        1,
        "hair_color/blond",
        1,
        "hair_color/brown",
        1,
        "location/europe",
        1,
        "location/europe/Sweden",
        1
      ]
    },
    "facet_dates": {},
    "facet_ranges": {},
    "facet_intervals": {},
    "facet_heatmaps": {}
  }
}

Note this section at the bottom of the result:

"facet_fields": {
  "tags_ss": [
    "location/europe/Norway",
    2,
    "hair_color/black",
    1,
    "hair_color/blond",
    1,
    "hair_color/brown",
    1,
    "location/europe",
    1,
    "location/europe/Sweden",
    1
  ]
},

It shows all tags as a flat list (not hierarchical).

5. Retrieve all data with a Solr query (with hierarchical faceting)

Query

Here is my problem. I don't know how to construct the query which returns the following result (the result already shown in the conceptual example above).

Result (fictitious, created by hand for illustration)

{
  "responseHeader":{
    "status":0,
    "QTime":0,
    "params":{
      "facet":"true",
      "indent":"true",
      "q":"*:*",
      "facet.field":"tags_ss",
      "wt":"json",
      "rows":"0"}},
  "response":{"numFound":3,"start":0,"docs":[]
  },
  "facet_counts":{
    "facet_queries":{},
    "facet_fields":{
      "tags_ss":[
        "hair_color,3, // This aggregations is missing
        "hair_color/black",1,
        "hair_color/blond",1,
        "hair_color/brown",1,
        "location/europe",4, // This aggregation should be 4 but is 1
        "location/europe/Norway",2,
        "location/europe/Sweden",1]},
    "facet_dates":{},
    "facet_ranges":{},
    "facet_intervals":{},
    "facet_heatmaps":{}}}

This tags list is still flat, but at least location/europe = 4 would be correctly aggregated, but currently it is not. I keep getting location/europe = 1 because it's only set for Alice and Bob's Norway and Sweden are not aggregated to also count towards Europe.

Ideas

Versions


Answer:

You can get all of your aggregations to be populated if you push them into the index in stages. If Bob is from Norway, you might populate up to three values in your facet field:

location
location/Europe
location/Europe/Norway

(As an alternate design, you might have a hair color field separate from the location field, and then "location" would never need to be populated in the field itself.)

Then your results are still flat but your aggregated totals are present. At that point, you will need to do some programmatic work with the result set to create a nested data structure built by splitting all of the values on your separator character (/ in this case). Once you have a nested data structure, then displaying it hierarchically should be manageable. It's hard to go into detail about this part of the implementation because your nested data structure and display will depend heavily on your development environment.

Another, somewhat risky, option to avoid adding repetitive entries into your Solr facet field is to add only the value you're using now (e.g. location/Europe/Norway), but to sum the leaf totals as your iterate through the facet list and build your nested data structure. The risk there is that if a person is genuinely associated with multiple countries in Europe, then you might get an inflated total for the higher level location/Europe. I have chosen in my own projects to populate the separate values, as above. Even though they seem redundant, the aggregate totals end up being more accurate.

(As usual in Solr, this is only one of quite a few ways of doing things. This model works best for systems with a manageable number of total leaves, where it makes sense to retrieve all of the facet values up front and not have to make additional drill-down queries.)

A pivoting option

Solr facet pivoting can return a hierarchically-structured result directly from Solr, but runs the risk of creating false connections between values in certain situations.

So, say you load your documents like this:

<add>
 <doc>
  <field name="id">Alice</field>
  <field name="continent">Europe</field>
 </doc>
 <doc>
  <field name="id">Jane</field>
  <field name="continent">Europe</field>
  <field name="country">Norway</field>
 </doc>
 <doc>
  <field name="id">Bob</field>
  <field name="continent">Europe</field>
  <field name="country">Norway</field>
  <field name="country">Sweden</field>
 </doc>
</add>

Now you perform a facet pivot query with facet.pivot.mincount=1&facet.pivot=continent,country. The results can be great so far:

"facet_pivot":{
 "continent,country":[{
  "field":"continent",
  "value":"Europe",
  "count":3,
  "pivot":[{
    "field":"country",
    "value":"Norway",
    "count":2,},
      {
    "field":"country",
    "value":"Sweden",
    "count":1,}]}]}

So far so good. The problem comes when you add a new person to the data:

<add>
 <doc>
  <field name="id">Susan</field>
  <field name="continent">Europe</field>
  <field name="country">Norway</field>
  <field name="continent">South America</field
  <field name="country">Brazil</field>
 </doc>
</add>

Now Solr doesn't actually know that Norway is in Europe and Brazil is in South America, so you will begin to get facet counts for "Europe > Brazil" and for "South America > Norway".

The problem is resolvable if you add continent prefixes to all of your country values:

<add>
 <doc>
  <field name="id">Susan</field>
  <field name="continent">Europe</field>
  <field name="country">Europe/Norway</field>
  <field name="continent">South America</field
  <field name="country">South America/Brazil</field>
 </doc>
</add>

This way you will still get the mismatched pivot values, but you can choose to block any country-level facet values that don't have a prefix matching their continent. For this to be an issue, a multivalued field in the pivot must have values associated with values appearing later in the same pivot. If you are not expecting to have multiple values for these fields in a single record or if your values don't have a strong association (i.e. specific parentage), pivot facets can be an ideal solution. But in some cases, the pivot facet's disassociation between values in the included fields can create a prohibitive mess.


Related:


Solr custom UpdateRequestProcessorFactory fails with “Error Instantiating UpdateRequestProcessorFactory”


java,solr,lucene,config,solrcloud
I have a custom class extending UpdateRequestProcessorFactory doing some work on a document when it gets added to the index. This was working fine in v4.10.3 in standalone Solr. I moved to SolrCloud v5.2 and it throws this error when adding the Collection (node): ERROR - 2015-06-14 12:25:11.071; [ docs_shard1_replica1]...

Django-Haystack with Solr: Searching by page description meta tags


solr,django-haystack,django-cms
I've been digging around and can't seem to find a way to create a search index for the page description meta tags using Haystack and Solr. Does anyone have experience with this, or any tips? I have looked at the page model in cms, but can't figure out how to...

Solr: Retrieve non-stored fields from external data source


solr,solr5,banana
I'm currently working on a project on which I would like to index several data sources (Oracle and HBase) into Solr for full text search. Additionally, I want to be able to visualize the data I index into Solr. I'm still evaluating on whether to use Banana or Hue for...

Solr 5.1.0: How to set the unique key via Schema API


solr,schema,unique-key
In Solr 5.1.0, is it possible to set the unique key via the REST schema api? I created a collection with the data driven schema. Solr would guess what the field type and create the field based on the data I upload. I can still define fields beforehand by sending...

Fields in apache solr response are multivalued when they should be singular


django,apache,solr,django-haystack,solr-multy-valued-fields
I'm experiencing a problem with Apache Solr where I'm receiving fields wrapped in lists in JSON responses but they should be singular. Here is an exerpt from schema.xml, two example fields giving me a problem are django_ct and django_id: <fields> <!-- general --> <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="true"/>...

Lucene vs Solr, indexning speed for sampe data


java,indexing,solr,lucene,full-text-search
I have worked upon Lucene before and now moving towards Solr. The problem is that I am not able to do Indexing on Solr as fast as Lucene can do. My Lucene Code: public class LuceneIndexer { public static void main(String[] args) { String indexDir = "/home/demo/indexes/index1/"; IndexWriterConfig indexWriterConfig =...

Solr 4.10.2 MySQL import fails with java.io.EOFException


mysql,solr
I'm trying to migrate a server with Solr 4.7.2 on it. I have a Solr 4.10.2 with 4 cores running which is the new machine. I have an importer running on the old machine that poses no problem. However, when trying to run the importer on the new machine, I...

How to index documents with their metadata in a DB using Solr 5.1.0


mysql,solr
I'm using Apache Solr to index documents for a search engine. These documents are stored locally on my file system. In order to do a faceted search I also have to include these documents meta-data which is stored in a MySQL DB. Is there a way to simultaneously index these...

SOLR to ignore some terms of a phrase


solr,solrnet
Is there a way to tell SOLR to search for (for example) 80% of the phrase "term1 term2 term3 term4" will yeild documents with at least 3 terms. Extra question - if such logic exists - will it work with proximity : "term1 term2 term3 term4"~15 specifically, tried to do...

can solr find all of the terms of a field of a document?


solr,solrcloud,inverted-index
solr uses inverted index to find the document from the indexed "terms". but what I wonder is that - is there any approach to know all of the terms which refer to a specific documents? thanks...

Understanding Apache Lucene's scoring algorithm


search,solr,lucene,full-text-search,hibernate-search
I'm working with Hibernate Search for months now, but still I'm not able to digest the relevance it brings. I'm overall satisfied with the results it returns, but even simplest test does not satisfy my expectation. First test was using the term frequency(tf). Data: word word word word word word...

How do I combine Facet and FilterQueries using Spring data Solr?


spring,solr,filtering,facet
Is it possible to combine a facet and field query in spring data solr? Something that would build a query like this: > http://localhost:8983/solr/myCore/select?q=lastName%3AHarris*&fq=filterQueryField%3Ared&wt=json&indent=true&facet=true&facet.field=state In other words, how do I add FilterParameters to a SimpleFacetQuery? Any/all replies welcome, thanks in advance, -- Griff...

Still seeing old shard after calling SPLITSHARD


solr
I called splitshard, and now this is what I see even after posting a commit: I thought splitshard was supposed to get rid of the original shard, shard1, in this case. Am I missing something? I was expecting the only two remaining shards to be shard1_0 and shard1_1. The REST...

Solr splits a field containing a URL when copying from destination to a copyfield


json,xml,indexing,solr
I'm using Solr 4.5.1 and i have these two fields indexed in solr : schema.xml <field name="event_id" type="custom_string" indexed="true" stored="true" /> <field name="text" type="text_fr" indexed="true" multiValued="true" stored="true"/> <copyField source="event_id" dest="text"/> <fieldType name="text_fr" class="solr.TextField" positionIncrementGap="100"> <analyzer> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> <!-- normalisation des accents,...

Connection refused when trying to access SOLR instance running in boot2docker on windows


solr,docker,boot2docker
I pulled this SOLR docker image and then followed the instructions to run it. docker run -d -p 8983:8983 -t makuk66/docker-solr Typing in docker ps yielded 1197d246f0e3 makuk66/docker-solr:latest "/bin/bash -c '/opt/ 50 minutes ago Up 50 minutes 0.0.0.0:8983->8983/tcp suspicious_sinoussi So I know it's running. In order to connect to it...

How can I sort by realtime score in solr?


solr
Now I have a solr collection: question question has some field: id answer_count created_at updated_at now I have the sort rule: score = answer_count * 100 - (the hours now to created_at) * 5 then I need to sort by the score desc. how can i do that because of...

solrcloud - choosing cores for update and search requests


solr,solrcloud
I have a SolrCloud with one collection configured with compositeId and numShards=3 and replicationFactor=2. there will be about 200K inserts a day and about as many searches. from the SolrCloud documentation: "If the machine is a replica, the document is forwarded to the leader for processing." Does this means that...

Partially indexing Cassandra table with SOLR


solr,cassandra,datastax-enterprise
One of the tables inside our Cassandra (DSE 4.7) Cluster contains south of 15 billion records. With the number of servers we have - it would be impossible to index them all with Solr. So, is it possible to somehow index the data partially/sample and/or start indexing and then "pause"...

DSpace error with oai import


solr,dspace,oai
After configuring my DSpace server, its working correctly but when I look at the OAI identify page (http://repositorio.puce.edu.ec/oai/request?verb=Identify) so we can be harvested, it says that the repository is localhost instead of my URL. I investigated and found out that to update this, I have to run this command: dspace/bin/dspace...

SOLR QueryElevationComponent for Multi-tenant Support


solr,multi-tenant
Newbie question so please be nice. :) Basically we need to implement editorial boosting for a multi-tenant SOLR environment wherein a pre-defined query from a user would always bring a certain set of documents at the top of the results. A couple of challenges we have include: Given a single...

How to use all the cores of Solr in solrj


java,indexing,solr,lucene,solrj
I have downloaded solr 5.2.0 and have started using $solr_home/bin/solr start The Logs stated: Waiting to see Solr listening on port 8983 [/] Started Solr server on port 8983 (pid=17330). Happy searching! Then I visited http://localhost:8983/solr and created a new core using Core Admin / new Core as Core1 (...

How to add individual objects to django haystack?


django,solr,django-haystack
I have a search index that I have created using Solr. I want to add individual django objects to the search index. To remove objects from the solr database we use remove_object. some = SomFooModel.objects.get(pk=1) foo = FooIndex() foo.remove_object(some) #This works To add it, is there something like add_object or...

Solr 5.1.0 - Apache TikaEntityProcessor Cannot Find My Files


mysql,solr,tika
Solr, more specifically Tika, is having some problems finding my file whose filepath is retrieved from a database. Whenever I go to index it logs errors saying that this can't find the file. I'm basically doing what this guy is doing here, which is taking a file path from a...

Fuzzy search not working with dismax query parser


solr,lucene
There is a field in my schema 'fullText' which is of the 'text_en' type, and multivalued. The term 'tests' is in the fullText field in one document. In solr, when I try to search using the word 'test', with the standard lucene parser with minimal distance 1, its returning the...

Heap memory Solr and Elasticsearch


solr,elasticsearch
I'm just reading the book Mastering Apache Solr and the writer recommends to set the minimum heap size (-Xms) to 2GB and the maximum heap size (-Xmx) to 12GB. Is 2GB necessary? I just use a 512MB server (which is low, I know) for Solr and I found it already...

How does ReversedWildcardFilterFactory speed up wildcard searches?


solr,full-text-search
The Solr docs say: solr.ReversedWildcardFilterFactory A filter that reverses tokens to provide faster leading wildcard and prefix queries. Add this filter to the index analyzer, but not the query analyzer. The standard Solr query parser will use this to reverse wildcard and prefix queries to improve performance... How does it...

Solr Cloud Managed Resources


solr,solrcloud,synonym,stop-words
I am implementing Solr Cloud for the first time. I've worked with normal Solr and have that down pretty well, but I'm not finding a lot on what you can and can't do with Solr Cloud. So my question is about Managed Resources. I know you can CRUD stop words...

Using schema.xml with Solr


xml,solr
I am trying to use schema.xml with the latest version of Solr (5.1.0). It seems that by default Solr 5.1.0 uses managed schema, but I would like to use schema.xml for a specific collection. So I create a new collection (using solr create -c my_collection on windows and copy schema.xml...

Getting application/json back from a Solr query


java,json,solr,jersey,jersey-client
I'm calling the Solr REST api using a Jersey client: final ClientResponse resp = client().path(queryPath()) .queryParam("q", query.getQuery()) .queryParam("wt", "json") .accept(MediaType.APPLICATION_JSON_TYPE) .get(ClientResponse.class); resp.getEntity(HttpResponse.class) and when I run it I get: A message body reader for Java class challenger.HttpResponse, and Java type class challenger.HttpResponse, and MIME media type text/plain; charset=UTF-8 was not...

Developing a search and tag heavy website


sql,database,web-applications,solr,nosql
I'm in the planning phase of developing a very tag heavy website. Everything will essentially be associated with tags and the entire site would be based on searching these tags. Now, I've been thinking a lot about going the nosql route here, since from what I read and understand, it...

TYPO3 Solr extension and facets


solr,typo3,typoscript,typo3-6.2.x
I have a small question about TYPO3 solr facets.At present in my website I have 6 different indexing configuration available. Two of them are custom extension table's and one is tt_news and rest of the 3 are pages table with some custom condition. I managed to add this using additionalWhereClause...

Solr date variable resolver is not working with MySql


mysql,oracle,solr,dataimporthandler
I have used Solr 3.3 version as Data Import Handler(DIH) with Oracle. Its working fine for me. Now I am trying the same with Mysql. With the change in database, I have changed the query used in data-config.xml for MySql. The query has variables which are passed url in http....

Solr Indexing in Storm topology vs Hbase NG Indexer


indexing,solr,hbase,storm
I am working on designing the Data Indexing feature into Solr. We are using Storm Topology and have a Hbase Bolt where it is adding data into Hbase. The requirement is what ever data we are adding into Hbase, needs to be indexed as well. The following are the options:...

What indexer do I use to find the list in the collection that is most similar to my list?


search,indexing,solr,levenshtein-distance
Lets say I have my list of ingredients: {'potato','rice','carrot','corn'} and I want to return lists from a database that are most similar to mine: {'beans','potato','oranges','lettuce'}, {'carrot','rice','corn','apple'} {'onion','garlic','radish','eggs'} My query would return this first: {'carrot','rice','corn','apple'} I've used Solr, and have looked at CloudSearch, ElasticSearch, Algolia, Searchify and Swiftype. These engines only...

Subentity SolrEntityProcessor stops working since SolR 5.x


solr,dataimporthandler,solr5
I use a data import like this <dataConfig> <document name="products"> <entity name="outer" dataSource="my_datasource" pk="id" query="..." deltaQuery="..." deltaImportQuery="..." > <entity name="solr" processor="SolrEntityProcessor" url="http://127.0.0.1:8983/solr/${solr.core.name}" query="Xid:${outer.Xid}" rows="1" fl="Id,FieldA,FieldB" wt="javabin" /> </entity> </document> </dataConfig> The interesting part is the sub entity, which uses SolrEntityProcessor. Until (including) SoLR 4.10 everything...

Solrcloud multicore configuration


solr,lucene,multicore,sharding,solrcloud
I have a standalone Solr instance with 4 different cores working fine using the embedded Jetty server. I configured the cores for v4.10.3 but since I moved to v5.1 and all seems to work fine without any changes. Before going into production, I need to set it up as a...

Heap size issue on migrating from Solr 5.0.0 to Solr 5.1.0


solr,jvm
I have a Solr 5.0.0 in production with a custom heap size like this SOLR_JAVA_MEM="-Xms2g -Xmx2g" When I tried to migrate to Solr 5.1.0 with the same configuration and start the server it returned a OutOfMemoryError. Looking to the Solr API I saw that the heap size was set to...

SOLR - highlight searching text ? Is this possible


solr,solrj,solr-highlight
I'm beginning with SOLR so please don't flame me if this question is stupid or something like this. I was reading solr documentation and found out that there is something called "highlight". I have really simple query: /select?q=text:test&wt=json&indent=true text is a field in my index and I'm trying to highlight...

Apache Solr Exception


php,apache,search,drupal,solr
Hello I am trying to run Solr on a Tomcat and have an exception like org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: directory '/var/lib/solr/data/index' does not exist Maybe anyone has some trouble like I do?...

How to store the file path of an indexed document in Apache Solr 5.1.0


mysql,solr
I'm trying to store the file path of an locally stored indexed document in Apache Solr so I can then update the index with metadata that is stored in a DB in MySQL. That file path is how I'm going to relate the document to its corresponding metadata I already...

Data import in solr from multiple entities


solr,dataimporthandler,data-import
Currently i have a Solr core, which is importing data from multiple entities, i.e 2 different MySQL tables. I have to import data in the same core through 3rd entity which is another core in the same Solr Database. I found a documentation on many different sites which were guiding...

Modelling a leaderboard/ranking list in Riak


solr,ranking,riak,leaderboard
I am currently researching databases for a scalable game backend. Riak looks very nice from an operational point of view. I can easily see how to model user and game data and statistics in Riak. But I have trouble with leaderboards/ranking lists. Assuming we have millions of players and the...

Solr boost direct match over fuzzy match


solr
Let's say I have a query like this: text_data:(Apple OR Apple~2) How do I know what boost value to provide to give the direct match a clear priority over the fuzzy match?...

dse cassandra solr doesnt return _uniqueKey in response


solr,cassandra,datastax,datastax-enterprise
Im using Datastax 4.6. My solr client queries data by using _uniqueKey. From version 4.6 the limitation about using simple primary key is removed. How can i configure solr or create table in cassandra, so that I receive in solr response information about synthetic key _uniqueKey. There is no problem...

Solr : stemming in a live cluster (reindexing issues)


solr,solr4,solrcloud
I have a live Solr cluster where stemming was not enabled and my schema.xml looks like this: .. <field name="Searchable_Text" type="text_general" indexed="true" stored="true" multiValued="false"/> .. <field name="text" type="text_general" indexed="true" stored="false" multiValued="true"/> .. <copyField source="Searchable_Text" dest="text" maxChars="3000"/> .. <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100"> <analyzer type="index"> <tokenizer...

solrException. XML parser doesn't support XInclude option


xml,tomcat,solr,lucene,xinclude
After configuring solr4.7.2 with tomcat 7, got the error in solrAdmin page stating SolrCore Initialization Failures fran92:org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: XML parser doesn't support XInclude option My solr.xml file contains one core <?xml version="1.0" encoding="UTF-8" ?> <solr persistent="true"> <cores host="${host:}" adminPath="/admin/cores" hostContext="${hostContext:solr}"> <core config="solrconfig.xml" name="fran92" instanceDir="generic" schema="schema.xml"...

Rails4 + sunspot search


mysql,ruby-on-rails,solr,sunspot
I am trying to use sunspot solr for searching with Rails 4 and mysql. I defined a searchable block in my model(eg XYZ): searchable do text :name, :stored => true string :id, :stored => true end I just want to search in "name". The "id" is the primary key. There...

solr bin/post - specify a document ID


solr
I am quite new to solr as such, and have set up everything as per the example, and it all works fine. However, I have one nagging issue, for which I do not seem to find a solution for. So, normally, I do the following using the SimplePostTool and it...

Is it possible to index views in Apache Solr


sql,view,solr
Let me first give you an example. I have two tables -table1 and table2. table1 has a field id_table2, which is a foreign key and references one of the fields in table2. So, when I want to scan table1, I make a query like: SELECT t1.attr_1_, t1.attr_2_, t2.attr_3_ FROM table1...

How to add multiple suggesters definition in solr search components


java,apache,solr,lucene,autosuggest
I am using solr 5.1. I am trying to configure multiple suggester definition in Solr search component according to Apache solr wiki. I have configured single suggester perfectly and it works perfect but whenever I try to configure multiple suggester it gives me following errors java.lang.NullPointerException at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:190) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:143)...