question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'json' query does not return expected results from 'application/json'

See original GitHub issue

Hi 👋 I’m a bit stumped by the behaviour I’m seeing in this implementation. For some reason the term json doesn’t return pages with API documentation in it, but application/json does. Is it related to the tokeniser?

I’ve created a jsfiddle here with the same content and the default pipeline functions turned off: https://jsfiddle.net/f3sbrtq2/25/

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
hoelzrocommented, Jul 31, 2018

@lewisnyman Hi! Your suspicions about the tokenizer are spot on; it only splits tokens on - characters and whitespace by default. lunr uses full tokens to consult its inverted index - it doesn’t find all documents containing application/json under the set of documents with the standalone json token, hence the “missing” results.

Another thing I noticed about your example; you remove everything from the builder pipeline, but you leave the search pipeline alone - you might want to this.searchPipeline.remove(lunr.stemmer) as well.

Out of curiosity, what are you trying to use lunr to accomplish? By removing all of the processing functions from the pipeline you’re removing a lot of the value of what lunr provides! Or was that just for the purposes of your example?

0reactions
lewisnymancommented, Aug 1, 2018

We’re using middleman-search which helpfully prebuilds the index but is not actively maintained manastech/middleman-search#29

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Json.NET JSONPath query not returning expected results
would work, but I obviously don't understand the syntax well enough. This returns an empty list: var test1 = json.SelectTokens("$.projects[*].
Read more >
Solve common issues with JSON in SQL Server
It seems that the text returned by the FOR JSON query is escaped as plain text. This happens only if WITHOUT_ARRAY_WRAPPER is specified....
Read more >
Parsing json outputs not returning expected results.
I am trying to parse JSON output and use it as a variable in a playbook. Whilst the JSON query works perfectly fine...
Read more >
The JSON query results does not return the full path - Ask TOM
The JSON query results does not return the full path Hi, I'm try to evaluate the Json query. e.g I have following json...
Read more >
Request and Response JSON Reference | Alexa Skills Kit
Your code must be resilient to these types of changes. For example, your code for deserializing a JSON request must not break when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found