text:
Q: solr search return results but some sentences before&after the text search are required I am using Apache Solr 3.6.0. I have indexed a file with this command:
 curl "http://localhost:8983/solr/update/extract?stream.file=/home/Desktop/DOCUMENTS/x.pdf&stream.contentType=application/pdf&literal.id=DOC_N&commit=true"

when I search for the text for example:
"http://localhost:8983/solr/select/?q=Getting+Started&version=2.2&start=0&rows=10&indent=on"

the result return is:
<response>
    <lst name="responseHeader">
        <int name="status">0</int>
        <int name="QTime">12</int>
        <lst name="params">
            <str name="indent">on</str>
            <str name="start">0</str>
            <str name="q">Getting Started</str>
            <str name="version">2.2</str>
            <str name="rows">10</str>
        </lst>
    </lst>
    <result name="response" numFound="3" start="0">
        <doc>
            <arr name="content_type">
                <str>application/pdf</str>
            </arr>
            <str name="id">doc2</str>
        </doc>
        <doc>
            <arr name="content_type">
                <str>application/pdf</str>
            </arr>
            <str name="id">1</str>
        </doc>
        <doc>
            <arr name="content_type">
                <str>application/pdf</str>
            </arr>
            <str name="id">DOC_N</str>
        </doc>
    </result>
</response>

What I am getting from this is that the result was found in the pdf. Now I want to implement a search like: it will return some text before & after that word that I have search from the pdf that was indexed.
please help.
here is my solrconfig.xml
<?xml version="1.0" encoding="UTF-8" ?>
<config>
    <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
    <luceneMatchVersion>LUCENE_36</luceneMatchVersion>
    <lib dir="../../dist/" regex="apache-solr-cell-\d.*\.jar" />
    <lib dir="../../contrib/extraction/lib" regex=".*\.jar" />
    <lib dir="../../dist/" regex="apache-solr-clustering-\d.*\.jar" />
    <lib dir="../../contrib/clustering/lib/" regex=".*\.jar" />
    <lib dir="../../dist/" regex="apache-solr-dataimporthandler-\d.*\.jar" />
    <lib dir="../../contrib/dataimporthandler/lib/" regex=".*\.jar" />
    <lib dir="../../dist/" regex="apache-solr-langid-\d.*\.jar" />
    <lib dir="../../contrib/langid/lib/" regex=".*\.jar" />
    <lib dir="../../dist/" regex="apache-solr-velocity-\d.*\.jar" />
    <lib dir="../../contrib/velocity/lib" regex=".*\.jar" />
    <dataDir>${solr.data.dir:}</dataDir>
    <directoryFactory name="DirectoryFactory"
                        class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>
    <indexConfig>
    </indexConfig>
    <jmx />
    <query>
        <maxBooleanClauses>1024</maxBooleanClauses>
        <filterCache class="solr.FastLRUCache"
                     size="512"
                     initialSize="512"
                     autowarmCount="0"/>
        <queryResultCache class="solr.LRUCache"
                          size="512"
                          initialSize="512"
                          autowarmCount="0"/>
        <documentCache class="solr.LRUCache"
                       size="512"
                       initialSize="512"
                       autowarmCount="0"/>
        <enableLazyFieldLoading>true</enableLazyFieldLoading>
        <queryResultWindowSize>20</queryResultWindowSize>
        <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
        <listener event="newSearcher" class="solr.QuerySenderListener">
            <arr name="queries">
            </arr>
        </listener>
        <listener event="firstSearcher" class="solr.QuerySenderListener">
            <arr name="queries">
                <lst>
                    <str name="q">static firstSearcher warming in solrconfig.xml</str>
                </lst>
            </arr>
        </listener>
        <useColdSearcher>false</useColdSearcher>
        <maxWarmingSearchers>2</maxWarmingSearchers>
    </query>
    <requestDispatcher>
        <requestParsers enableRemoteStreaming="true"
                        multipartUploadLimitInKB="2048000" />
        <httpCaching never304="true" />
    </requestDispatcher>
    <requestHandler name="/select" class="solr.SearchHandler">
        <lst name="defaults">
            <str name="echoParams">explicit</str>
            <int name="rows">10</int>
            <str name="df">text</str>
        </lst>
    </requestHandler>
    <requestHandler name="/browse" class="solr.SearchHandler">
        <lst name="defaults">
            <str name="echoParams">explicit</str>

            <str name="wt">velocity</str>
            <str name="v.template">browse</str>
            <str name="v.layout">layout</str>
            <str name="title">Solritas</str>
            <str name="df">text</str>
            <str name="defType">edismax</str>
            <str name="q.alt">*:*</str>
            <str name="rows">10</str>
            <str name="fl">*,score</str>
            <str name="mlt.qf">
                text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
            </str>
            <str name="mlt.fl">text,features,name,sku,id,manu,cat</str>
            <int name="mlt.count">3</int>
            <str name="qf">
                text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
            </str>
            <str name="facet">on</str>
            <str name="facet.field">cat</str>
            <str name="facet.field">manu_exact</str>
            <str name="facet.query">ipod</str>
            <str name="facet.query">GB</str>
            <str name="facet.mincount">1</str>
            <str name="facet.pivot">cat,inStock</str>
            <str name="facet.range.other">after</str>
            <str name="facet.range">price</str>
            <int name="f.price.facet.range.start">0</int>
            <int name="f.price.facet.range.end">600</int>
            <int name="f.price.facet.range.gap">50</int>
            <str name="facet.range">popularity</str>
            <int name="f.popularity.facet.range.start">0</int>
            <int name="f.popularity.facet.range.end">10</int>
            <int name="f.popularity.facet.range.gap">3</int>
            <str name="facet.range">manufacturedate_dt</str>
            <str name="f.manufacturedate_dt.facet.range.start">NOW/YEAR-10YEARS</str>
            <str name="f.manufacturedate_dt.facet.range.end">NOW</str>
            <str name="f.manufacturedate_dt.facet.range.gap">+1YEAR</str>
            <str name="f.manufacturedate_dt.facet.range.other">before</str>
            <str name="f.manufacturedate_dt.facet.range.other">after</str>
            <requestHandler name="/update/javabin"
                            class="solr.BinaryUpdateRequestHandler" />
            <requestHandler name="/update/csv"
                            class="solr.CSVRequestHandler"
                            startup="lazy" />
            <requestHandler name="/update/json"
                            class="solr.JsonUpdateRequestHandler"
                            startup="lazy" />
            <requestHandler name="/update/extract"
                            startup="lazy"
                            class="solr.extraction.ExtractingRequestHandler" >
                <lst name="defaults">

                    <str name="fmap.content">text</str>
                    <str name="lowernames">true</str>
                    <str name="uprefix">ignored_</str>

                    <str name="captureAttr">true</str>
                    <str name="fmap.a">links</str>
                    <str name="fmap.div">ignored_</str>
                </lst>
            </requestHandler>
            <requestHandler name="/update/xslt"
                            startup="lazy"
                            class="solr.XsltUpdateRequestHandler"/>
            <requestHandler name="/analysis/field"
                            startup="lazy"
                            class="solr.FieldAnalysisRequestHandler" />
            <requestHandler name="/analysis/document"
                            class="solr.DocumentAnalysisRequestHandler"
                            startup="lazy" />
            <requestHandler name="/admin/"
                            class="solr.admin.AdminHandlers" />
            <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
                <lst name="invariants">
                    <str name="q">solrpingquery</str>
                </lst>
                <lst name="defaults">
                    <str name="echoParams">all</str>
                </lst>
            </requestHandler>

            <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
                <lst name="defaults">
                    <str name="echoParams">explicit</str>
                    <str name="echoHandler">true</str>
                </lst>
            </requestHandler>
            <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
                <str name="queryAnalyzerFieldType">textSpell</str>
                <lst name="spellchecker">
                    <str name="name">default</str>
                    <str name="field">name</str>
                    <str name="spellcheckIndexDir">spellchecker</str>

                </lst>
            </searchComponent>
            <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
                <lst name="defaults">
                    <str name="df">text</str>
                    <str name="spellcheck.onlyMorePopular">false</str>
                    <str name="spellcheck.extendedResults">false</str>
                    <str name="spellcheck.count">1</str>
                </lst>
                <arr name="last-components">
                    <str>spellcheck</str>
                </arr>
            </requestHandler>
            <searchComponent name="tvComponent" class="solr.TermVectorComponent"/>
            <requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy">
                <lst name="defaults">
                    <str name="df">text</str>
                    <bool name="tv">true</bool>
                </lst>
                <arr name="last-components">
                    <str>tvComponent</str>
                </arr>
            </requestHandler>
            <searchComponent name="clustering"
                             enable="${solr.clustering.enabled:false}"
                             class="solr.clustering.ClusteringComponent" >

                <lst name="engine">

                    <str name="name">default</str>

                    <str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
                    <str name="LingoClusteringAlgorithm.desiredClusterCountBase">20</str>
                    <str name="carrot.lexicalResourcesDir">clustering/carrot2</str>
                    <str name="MultilingualClustering.defaultLanguage">ENGLISH</str>
                </lst>
                <lst name="engine">
                    <str name="name">stc</str>
                    <str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
                </lst>
            </searchComponent>

            <requestHandler name="/clustering"
                            startup="lazy"
                            enable="${solr.clustering.enabled:false}"
                            class="solr.SearchHandler">
                <lst name="defaults">
                    <bool name="clustering">true</bool>
                    <str name="clustering.engine">default</str>
                    <bool name="clustering.results">true</bool>

                    <str name="carrot.title">name</str>
                    <str name="carrot.url">id</str>

                    <str name="carrot.snippet">features</str>

                    <bool name="carrot.produceSummary">true</bool>
                    <bool name="carrot.outputSubClusters">false</bool>
                    <str name="df">text</str>
                    <str name="defType">edismax</str>
                    <str name="qf">
                        text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
                    </str>
                    <str name="q.alt">*:*</str>
                    <str name="rows">10</str>
                    <str name="fl">*,score</str>
                </lst>
                <arr name="last-components">
                    <str>clustering</str>
                </arr>
            </requestHandler>
            <searchComponent name="terms" class="solr.TermsComponent"/>
            <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
                <lst name="defaults">
                    <bool name="terms">true</bool>
                </lst>
                <arr name="components">
                    <str>terms</str>
                </arr>
            </requestHandler>
            <searchComponent name="elevator" class="solr.QueryElevationComponent" >

                <str name="queryFieldType">string</str>
                <str name="config-file">elevate.xml</str>
            </searchComponent>

            <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
                <lst name="defaults">
                    <str name="echoParams">explicit</str>
                    <str name="df">text</str>
                </lst>
                <arr name="last-components">
                    <str>elevator</str>
                </arr>
            </requestHandler>
            <searchComponent class="solr.HighlightComponent" name="highlight">
                <highlighting>

                    <fragmenter name="gap"
                                default="true"
                                class="solr.highlight.GapFragmenter">
                        <lst name="defaults">
                            <int name="hl.fragsize">100</int>
                        </lst>
                    </fragmenter>

                    <fragmenter name="regex"
                                class="solr.highlight.RegexFragmenter">
                        <lst name="defaults">

                            <int name="hl.fragsize">70</int>

                            <float name="hl.regex.slop">0.5</float>

                            <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
                        </lst>
                    </fragmenter>

                    <formatter name="html"
                               default="true"
                               class="solr.highlight.HtmlFormatter">
                        <lst name="defaults">
                            <str name="hl.simple.pre"><![CDATA[]]></str>
                            <str name="hl.simple.post"><![CDATA[]]></str>
                        </lst>
                    </formatter>
                    <encoder name="html"
                             class="solr.highlight.HtmlEncoder" />
                    <fragListBuilder name="simple"
                                     default="true"
                                     class="solr.highlight.SimpleFragListBuilder"/>

                    <fragListBuilder name="single"
                                     class="solr.highlight.SingleFragListBuilder"/>

                    <fragmentsBuilder name="default"
                                      default="true"
                                      class="solr.highlight.ScoreOrderFragmentsBuilder">

                    </fragmentsBuilder>

                    <fragmentsBuilder name="colored"
                                      class="solr.highlight.ScoreOrderFragmentsBuilder">
                        <lst name="defaults">
                            <str name="hl.tag.pre"><![CDATA[
                   ,,
                   ,,
                   ,,
                   ,,
                   ,]]></str>
                            <str name="hl.tag.post"><![CDATA[]]></str>
                        </lst>
                    </fragmentsBuilder>
                    <boundaryScanner name="default"
                                     default="true"
                                     class="solr.highlight.SimpleBoundaryScanner">
                        <lst name="defaults">
                            <str name="hl.bs.maxScan">10</str>
                            <str name="hl.bs.chars">.,!?

</str>
                        </lst>
                    </boundaryScanner>
                    <boundaryScanner name="breakIterator"
                                     class="solr.highlight.BreakIteratorBoundaryScanner">
                        <lst name="defaults">
                            <str name="hl.bs.type">WORD</str>
                            <str name="hl.bs.language">en</str>
                            <str name="hl.bs.country">US</str>
                        </lst>
                    </boundaryScanner>
                </highlighting>
            </searchComponent>
            <queryResponseWriter name="json" class="solr.JSONResponseWriter">
                <str name="content-type">text/plain; charset=UTF-8</str>
            </queryResponseWriter>
            <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy"/>

            <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
                <int name="xsltCacheLifetimeSeconds">5</int>
            </queryResponseWriter>

            <admin>
                <defaultQuery>*:*</defaultQuery>

            </admin>
            <searchComponent name="suggest_full" class="solr.SpellCheckComponent">
                <str name="queryAnalyzerFieldType">suggestTextFull</str>
                <lst name="spellchecker">
                    <str name="name">suggest_full</str>
                    <str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
                    <str name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str>
                    <str name="field">text_suggest_full</str>
                    <str name="fieldType">suggestTextFull</str>
                </lst>
            </searchComponent>
            <requestHandler name="/suggest_full" class="org.apache.solr.handler.component.SearchHandler">
                <lst name="defaults">
                    <str name="echoParams">explicit</str>
                    <str name="spellcheck">true</str>
                    <str name="spellcheck.dictionary">suggest_full</str>
                    <str name="spellcheck.count">10</str>
                    <str name="spellcheck.onlyMorePopular">true</str>
                </lst>
                <arr name="last-components">
                    <str>suggest_full</str>
                </arr>
            </requestHandler>
            <requestHandler name="edismax" class="solr.SearchHandler" default="true">
                <lst name="defaults">
                    <str name="defType">edismax</str>
                    <str name="echoParams">explicit</str>
                    <float name="tie">0.1</float>
                    <str name="fl">keywords</str>
                    <str name="mm">1</str>
                    <str name="qf">kw_stopped^1.0 kw_phrases^5.0</str>
                    <str name="pf">kw_phrases^50.0</str>
                    <int name="ps">3</int>
                    <int name="qs">3</int>
                    <str name="q.alt">*:*</str>
                </lst>
            </requestHandler>
            <highlighting>

                <fragmenter name="gap" class="org.apache.solr.highlight.GapFragmenter" default="true">
                    <lst name="defaults">
                        <int name="hl.fragsize">100</int>
                    </lst>
                </fragmenter>

                <fragmenter name="regex" class="org.apache.solr.highlight.RegexFragmenter">
                    <lst name="defaults">

                        <int name="hl.fragsize">70</int>

                        <float name="hl.regex.slop">0.5</float>

                        <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
                    </lst>
                </fragmenter>

                <formatter name="html" class="org.apache.solr.highlight.HtmlFormatter" default="true">
                    <lst name="defaults">
                        <str name="hl.simple.pre"><![CDATA[]]></str>
                        <str name="hl.simple.post"><![CDATA[]]></str>
                    </lst>
                </formatter>
            </highlighting>

            <fragmentsBuilder name="colored" class="org.apache.solr.highlight.ScoreOrderFragmentsBuilder">
                <lst name="defaults">
                    <str name="hl.tag.pre"><![CDATA[
             ,,
             ,,
             ,,
             ,,
             ,]]></str>
                    <str name="hl.tag.post"><![CDATA[]]></str>
                </lst>
            </fragmentsBuilder>
            <boundaryScanner name="breakIterator" class="solr.highlight.BreakIteratorBoundaryScanner">
                <lst name="defaults">
                    <str name="hl.bs.type">WORD</str>
                    <str name="hl.bs.language">en</str>
                    <str name="hl.bs.country">US</str>
                </lst>
            </boundaryScanner>
            <boundaryScanner name="simple" class="solr.highlight.SimpleBoundaryScanner" default="true">
                <lst name="defaults">
                    <str name="hl.bs.maxScan">10</str>
                    <str name="hl.bs.chars">.,!?\t\n</str>
                </lst>
            </boundaryScanner>
</config>

A: Solr highlighting provides the option to highlight the searched term and returns text before and after the match.
You can check for the Solr highlight feature.
Check out the Highlighting Parameters to configure it.


text:
Poetry Authors
Prose Authors
Poetry Translators
Prose Translators
Access the books
Blog-text
Music that stirs your soul (no. 1)
Chris McNab | 3 March 2019
I'm writing this blog entry some weeks after my recent, and extremely memorable, visit to Kazakhstan. In the intervening period, I have had the pleasure of editing nearly 90,000 words of Kazakh poetry, for the first time translated into polished English.
At the time of writing this blog, this likely means that I have had more exposure to Kazakh poetry than more than 99 per cent of literary academics in the Western world. Hopefully, the publication of the anthology later this year will change this egregious imbalance.
The hope is that this work, plus the corresponding prose anthology, will reach as wide an audience as possible, not just in academia but across all ages, interests and communities.
My editorial journey has taken me through a body of work as diverse as that of any other country. The poetry crosses subject matter, mood, outlook and style with great diversity and range. And yet, I do feel that there is a distinctly Kazakh 'voice' underpinning it all.
Putting my finger on exactly what constitutes this voice, however, is not entirely straightforward. Much poetical content, in any language, is transmitted through evocation rather than clear statement, and an active search for 'meaning' can sometimes be almost wilfully missing the point.
Kazakh poetry can also be, depending on its style, deliberately difficult and evasive as much as it can be transparent and accessible. We have to be careful, therefore, of being reductionist, of trying to boil down a disparate and occasionally challenging corpus of literature to a few definable characteristics. I know the risks, but I'll have a go anyway. Why? Because I feel that the distinct Kazakh voice has much to say to the international reader – spiritually, culturally and even socially. The core ingredients of this voice will be the subject of my next blog.
Dr Chris McNab is an author, editor and publishing consultant, who has a long-standing relationship with both Cambridge University Press and with Kazakhstan. Chris is working as the editor of the poetry anthology for this project.
Poem of the week: And Again About Love by Akkushtap Baktygereyeva
Love, I have come back to you again – be my theme, repeating once more. There is no life without…
Contemporary Kazakh Culture in the Global World at the London Book Fair
The London Book Fair (LBF) is the global marketplace for rights negotiation and the sale and distribution of content across…
Translating Kazakh Poetry: the Art of the Possible
In an ideal world the kind of person best qualified to translate Kazakh poetry into English would be someone equally…
One of the main pillars of this programme is the translation of two anthologies of modern Kazakh literature – one prose, one poetry – into six UN languages, which is the focus of this project. Learn more
University Printing House, Shaftesbury Road
Cambridge CB2 8BS
educationreform@cambridge.org

redpajama_set_name: RedPajamaCommonCrawl


Published by Dan Parsons, London, UK on Dec 19 2018.
For anyone staying in North Goa who has looked on Google and seen the distance is 60km and thought 'that should take about an hour and a quarter', think again. Two and a half hours after setting from Candolim off in a cab we arrived at the gates. Do not let this put you off visiting, it gives you the chance to see a bit more of Goa on route. Alternatively, just holiday in the South from where the journey is a little easier.
Greeted by Pankaj, who was showing us around, at the entrance you are welcomed by 2 sculpted elephants who are holding bells in their trunks. This visitor centre has an old colonial feel to it with tiled floors and lovely high arched windows letting in lots of light, completely in keeping with its environment, and has a sanctum like feel to it. If this is a temple to Indian Single Malt whisky then i am a pilgrim.
On to look at the stills and the distilling process, interestingly this distillery has no lock on their spirit safe. For anybody who has traveled in India and experienced Indian bureaucracy this was a big surprise. We were invited to try the new make spirit and i have to say it is uncommonly sippable. Whether this is to do with the use of 6 row barley from the foothills of the Himalayas or not i am unsure but it certainly is a sweeter, smoother spirit than any i have tried before.
Next was a visit to the warehouses where over 8000 casks are currently maturing (and at a rate that Scottish distillerys can only dream of achieving due to the climate, i am told 1 year ageing here is equivalent to 4 in Scotland) we saw predominantly bourbon casks but also sherry and i am sure i also spotted the odd wine cask. I couldn't tell you what wine it was but look forward to seeing if it makes its way into a bottle in future. There also appears to be building work going on to increase the warehouse capacity.
Lastly a visit to the tasting room where you can see me standing behind the bar in the picture wishing that was my actual job, where we were invited to taste the range. It was a little early in the day to do the complete flight so i plumped to try the Brilliance, The Bold, the Classic Select Cask and the Xmas Edition 2018.
A blend of peated and unpeated malts finished in Oloroso. Whilst this is no 'Sherry Bomb' the Oloroso characteristics are definitely there. Honeyed on the nose, dried fruits and citrus hints that seem to be consistent across the whole Paul John range. An exquisite almost oily coating on the palate, the taste is absolutely festive, xmas pud, more dried fruits and waxy orange peel followed by a strong finish of gentle spice. I will definitely be sharing a bottle of this with my guests over Christmas and can heartily recommend.
I would call this the entry level whisky of the range and if i ever am invited around to any of your houses and you offer me a dram of this i would be more than happy. For my wife Dolly, who has not drunk whisky since as a 7 year old she downed a glass thinking it was apple juice (and after having been dragged around more than the odd distillery), this was her first taste of whisky for many years. I think she accepted out of politeness but.................hallelujah, she enjoyed it!!!! Thank you, thank you, thank you Paul John for sewing the first seeds of conversion.
Sweet fruit on the nose, memories of foam candy sweets from childhood. Taste, more fruits and hints of chocolate, lots of honeyed sweetness with lovely peppery spice. I love it.
Peated but i would say gently peated. This is no Octomore. The nose reminds me of cleaning out the hearth the day after a wood fire. Toast, orange peel and demerara. Tastes fruity, sweet and spicy. Very pleasant but not 'Bold' enough for my liking.