Custom format for search engine



  • I'm trying to add new search engine for Cambridge Dictionary. It works fine, but i also want to add suggestion feature (autocomplete).
    They use the following format:
    https://dictionary.cambridge.org/autocomplete/british-grammar/?q=%s
    But output contains the different json format (e.g. "hello" word):

    {"results":[{"searchtext":"Hello there!"},{"searchtext":"Greetings and farewells: hello, goodbye, Happy New Year"},{"searchtext":"Saying hello"}]}
    

    Is it possible to make it work?

    UPD. As a result, I wrote a wrapper with my website address, which converts the data into a format supported by the browser. It works perfectly. But I have a problem with incomplete OpenBrowser/Suggestions support. I wrote about it at the bottom of the page.



  • That could be interesting, your question is maybe not specific to a search engine, but it could be applied to every ones, like Google search.
    google.com : You have suggestions (autocomplete)
    Same engine from Vivaldi bar : No Google, autocomplete, only history, bookmarks, typed...

    dictionary.cambridge.org :Same as Google.

    On firefox you have the same as Vivaldi but there are Google suggestions at the bot of the suggestion list.
    Dunno if it's related to any engines or just Google.

    That a good idea to me.



  • Hello @Purgator,
    Google suggestions are disabled by default. You can enable it.
    Just add the following string to the suggestion editbox:
    https://www.google.com/complete/search?client=chrome&q=%s

    0_1493887433568_2017-05-04-114236_431x323_scrot.png

    It is also necessary to enable this feature in the address or the search bar:
    0_1493887745209_2017-05-04-114810_356x109_scrot.png



  • I just read the wiki lol. I was about to answer myself, thank you anyway :p
    I'm actually completing it.

    BTW do you know what is the point to specify the browser ? Vivaldi wiki use client=firefox in the search string.
    https://wiki.vivalditips.com/en/latest/Settings/add-search-suggestions-to-search-engines/

    EDIT : I tryed both, suggestions are not the same, i'm gonna pick firefox, results seems to fit better to me.



  • @Purgator browser name may be necessary to return a correct data format for a browser.



  • I did a little research. Vivaldi partially supports a data format, called as "OpenSearch/Extensions/Suggestions"
    It works fine for data like:

    ["keyWord", ["resultWordFirst", ..., "resultWordLast"]] 
    
    ["get",["get","get a feel for something","get a fix on sth","get a grip on yourself","get a jump on sb/sth","get a jump on someone/something","get a life","get a line on sb","get a load of that!","get a move on"]]
    

    But it doesn't work for descriptions and query url's. Vivaldi ignores it:

    ["keyWord", ["resultWordFirst", ..., "resultWordLast"], ["descForFirst", ..., "descForLast"], ["firstURL", ..., "lastUrl"]] 
    
    ["get", ["get", "get a feel for something", "get a fix on sth", "get a grip on yourself", "get a jump on sb/sth", "get a jump on someone/something", "get a life", "get a line on sb", "get a load of that!", "get a move on"],
        ["desc1text_here", "desc2text_here", "desc3text_here", "desc4text_here", "desc5text_here", "desc6text_here", "desc7text_here", "desc8text_here"],
        ["https://dictionary.cambridge.org/dictionary/english/get", "https://dictionary.cambridge.org/dictionary/english/get-a-feel-for-something", "https://dictionary.cambridge.org/dictionary/english/get-a-fix-on-sth", "https://dictionary.cambridge.org/dictionary/english/get-a-grip-on-yourself", "https://dictionary.cambridge.org/dictionary/english/get-a-jump-on-sb-sth", "https://dictionary.cambridge.org/dictionary/english/get-a-jump-on-someone-something", "https://dictionary.cambridge.org/dictionary/english/get-a-life", "https://dictionary.cambridge.org/dictionary/english/get-a-line-on-sb", "https://dictionary.cambridge.org/dictionary/english/get-a-load-of-that", "https://dictionary.cambridge.org/dictionary/english/get-a-move-on"]
    ]
    

    Vivaldi uses predefined URL from search engine + word from suggestions instead of JSON's query url. This isn't always good and it will not allow to use more complex search engines. If a query url from the suggestions contains in the JSON's "query url" and it isn't equals search engine string plus selected word then final url is not correct.
    I'm right?



  • I got you, if that not works you may ask for a feature request.

    Difference between Google and Dictionary.cambridge matching hello :

    ["hello",["hello","hello fresh","hello google","hello neighbor","hello kitty","hello lyrics","hello hello","hello world","hello molly","hello how are you"]]

    {"results":[{"searchtext":"Hello there!"},{"searchtext":"Greetings and farewells: hello, goodbye, Happy New Year"},{"searchtext":"Saying hello"}]}

    It can be simplified :

    [ [ ] ]
    { [ { }{ }{ } ] } or useful data : { }{ }{ }

    I added Dictionary.cambridge as search engine with the suggestion string you provided and there is stictly nothing.
    Then let's add a feature request... or build a server that handle this suggest string and format it as [ [ ] ] xD



  • @Purgator
    Url address for suggestions in the Cambridge Dictionary is not intended for use in the browser. It is my own wish to add that. I described my solution for the data format in the first message before.

    However, additional support for the standard would be great.

    I'm curious to know more about supported formats for suggestions.
    Maybe one of the developers will answer here



  • @snql Wait and see. Moderators are pretty effective here :)


  • Moderator

    @snql: Though the developers try to read here as much as possible, don't expect too much in the way of responses. They are VERY busy trying to build a browser. They are a few thousand feature requests in arrears, and changes in Chromium keep them busy with breakfixes as well.

    The request in this thread strikes me a kind of an edge case. That doesn't mean it won't be considered (especially if it's trivial to deploy), but it does mean it's likely to be a low priority.



Looks like your connection to Vivaldi Forum was lost, please wait while we try to reconnect.