Question

I have a Solr Search server which I am inserting very large text files, each of which are about 10 MB plain text file.

Fields are as follows:

    [SolrUniqueKey("id")]
    public int Id { get; set; }

    [SolrField("text")]
    public string Content { get; set; }

I am able to Add Documents without a problem, when i try to query and retrieve I dont get back the Content field, even though I should. I am getting back null.

Why is that happening?

Also, say I have a very large file then I searched for a term, while returning I want to get back only the part the data that query text is present. Is this possible via solr? how/

Was it helpful?

Solution

I am guessing you are trying to learn Solr and SolrNet at the same time and using example schema with following definition:

<field name="text" type="text_general" indexed="true" stored="false" multiValued="true"/>

Notice that stored="false" here because the field is used for searching only and is a target of multiple copyField operations.

You need to build your own schema that corresponds to what you want to do. You can find a couple of basic ones in the examples from my book (e.g. here, or here)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top