Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 798279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:56:39+00:00 2026-05-14T22:56:39+00:00

Is it possible to get the information why/how given row returned by FTS query

  • 0

Is it possible to get the information why/how given row returned by FTS query was matched (or which substring caused row to match)?
For example, consider simpliest table with id and text columns, with FTS index on the later one.

SELECT * FROM Example
WHERE CONTAINS(text, 'FORMSOF(INFLECTIONAL, jump)');

This examplary query could return, say row {1, 'Jumping Jack'}.

Now, is it possible to somehow get information that this very row was matched because of 'Jumping' word? It doesn’t even have to be exact information, more of a which substring caused row to match.

Why I’m asking – I got C# app that builds up those queries basing on user input (keywords to search for), and I need the very basic information why/how row was matched back, to use further in C# code.

If it’s not possible, any alternatives?


EDIT in regards of Mike Burton’s and LesterDove’s replies:

The above example was trivial for obvious reasons and your solutions are ok having that in mind, however FTS queries might return results where regex or simple string matching (eg. LIKE) won’t cut in. Consider:

Search for bind returns bound (past form).
Search for extraordinary returns amazing (synonym).

Both valid matches.

I’ve been looking for solutions to this problem and found this: NHunspell. However, I already got FTS & valid results using SQL Server, duplicating similar mechanism (building extra indexes, storing additional words/thezaurus files etc) doesn’t look good.

Lester’s answer however gave me some ideas that perhaps I could indeed split the original string to temporary table, and run the original FTS query on this split result. As it might work for my case (where DB is fairly small and queries are not very complex), in general case this approach might be out of question.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T22:56:40+00:00Added an answer on May 14, 2026 at 10:56 pm

    1/ Use a SPLIT function (many variations can be Googled) on your original substring, which will dump the individual substrings into a temp table of some sort, with one row per substring snippet.

    2/ EDIT: You need to use CROSS APPLY to join to a table valued function:

    SELECT * FROM Example E CROSS APPLY Split(E.text, ' ') AS S 
    WHERE CONTAINS(E.text, 'FORMSOF(INFLECTIONAL, jump)') AND S.String LIKE '%jump%';
    

    *NOTE: You need to forage for your own user-defined Split function. I used this one and applied the first commenter’s edit to allow for the space character as a delimiter.

    So, E is your Example table. You’re still FT searching on the text field for the word ‘jump’. And now you’re “joining” to a table comprised of the individual substring values of your text field. Finally, you’re matching that against the word ‘jump’ by using LIKE or Instr.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible get the assembly information from an imported MEF function? I need
Is it possible to get the information (app icon, app name, app location) about
I have some information stored as SharedPreferences. I need to access that information from
I volunteer for a local non-profit that gives out toys and food during the
I have a set of png images that I would like to process with
Previous I issued a question on how to change Maven project vesion from command
I have some html that creates a dropdown list. The list has text values
I'm trying to post via curl, I've been using the same code over and
I have acquired a DLL that was created in Visual Basic from a third
I am trying to learn how to use Abaqus Scripting. I just downloaded Eclipse

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.