0

I have an index rt with following configuration

index rt
{

    type            = rt
    min_stemming_len = 4
    morphology = stem_en
    wordforms   = /home/mis/syns.txt
    exceptions = /home/mis/exp.txt
    # english charset defined with alias
    #charset_table = 0..9, english, _
    phrase_boundary = ., ?, !
    path            = /var/lib/sphinxsearch/data/rt
    rt_field        = title
    rt_field        = content
    rt_attr_string      = content
    rt_attr_string      = title
    rt_attr_uint        = gid
}

and data in Index is

mysql> select * from rt;
+------+------+--------------------------------------------------------------------+-------+
| id   | gid  | content                                                           | title |
+------+------+--------------------------------------------------------------------+-------+
|    1 |    2 | This is a test with  walks. Then No data  shown. Wow This is fine. | test1 |
|    2 |    2 | This is a test with  walks                                         | test1 |
+------+------+--------------------------------------------------------------------+-------+
2 rows in set (0.00 sec)

I would like to get only "Wow This is fine." From rt index with snippet. I set boundaries to the index. So that i can use the use_boundaries option for spippent. But still i am not getting the excepted result.

SELECT id, SNIPPET(content, 'wow', 'use_boundaries=1') as t  FROM rt;
+------+---------------------------------------------------------------------------+
| id   | t                                                                         |
+------+---------------------------------------------------------------------------+
|    1 | This is a test with  walks. Then No data  shown. <b>Wow</b> This is fine. |
|    2 | This is a test with  walks                                                |
+------+---------------------------------------------------------------------------+
2 rows in set (0.01 sec)

any way i can use phrase_boundary to return the result by 'sentence'

Abhilash Joseph
  • 1,196
  • 1
  • 14
  • 28

1 Answers1

0

Dont see any reason why use_boundaries wouldnt work.

Sounds like you also want limit_passages=1 to get just the one passage in result.

Maybe also allow_empty=1, to deal with the second document, where its been unable to highlight the query word.

barryhunter
  • 20,886
  • 3
  • 30
  • 43
  • Thank You @barryhunter. It's weird . I am trying from a long time to make it work :( – Abhilash Joseph Feb 15 '17 at 12:48
  • Also if you try searching in www.unicourt.com . you can find many other issues with the snippet . – Abhilash Joseph Feb 15 '17 at 12:49
  • Nice though description of the problem there! Need to give us more that 'many issues' - to actully know what your problems are... – barryhunter Feb 15 '17 at 17:16
  • When you search for "class action" my results highlights OF CLASS ACTION , AS CLASS ACTION etc .. i reported it in Sphinx Bug. But I did not get any response from any one :( . Forum (http://sphinxsearch.com/forum/view.html?id=14417) . Bug Tracker (http://sphinxsearch.com/bugs/view.php?id=2500) – Abhilash Joseph Feb 16 '17 at 04:41