1

So, reading about an issue on the official documentation, I figured that we can have multivalued field as :

solr.add([
    {
        "id": "doc_1",
        "title": "A test document",
        "link": ["baidu.com", "google.com"]
    }

Now, I would like to index the docs on both the title and link field, how can I do that? And what is the default field it is indexed on?

Dreams
  • 5,854
  • 9
  • 48
  • 71
  • What do you mean by "index the docs on both the title and link field"? Querying for `link:baidu.com` would give you this document back by default, depending on the type of field `link` is. – MatsLindh Aug 18 '17 at 10:24
  • @MatsLindh - So, when the documents are indexed, they are indexed on all the fields by default? I mean when the search for a term happens, how does it evaluate which field to check? – Dreams Aug 18 '17 at 10:32
  • Which field to search is either given as part of the query syntax (`field:value`), through the default field (if none is given, either configured in your schema or in the `df` parameter) or for the (e)dismax handlers, through the `qf` (query fields) parameter. Fields are indexed as long as they're defined as indexed in your schema. If you're running in schemaless mode (which is not really schemaless, the fields are just added to the schema if they don't already exist), the field is indexed by default. You'd probably want a string field and not a text field for a URL field. – MatsLindh Aug 18 '17 at 10:39
  • @MatsLindh - okay, Thanks for the input. Will dig deeper and check it out. Thanks for the elaborate explaination :) – Dreams Aug 18 '17 at 10:49

0 Answers0