Giter Club home page Giter Club logo

Comments (5)

wujita01 avatar wujita01 commented on August 17, 2024

确认了搜索的关键字在Joplin里是有的。但是还是会返回[],表示为空。我用的是terminal版本。

from joppy.

marph91 avatar marph91 commented on August 17, 2024

I could only translate it online, since I don't speak any asian language. As far as I understood, the search API doesn't work for you sometimes. Could you give some example strings that don't work? I can imagine there might be problems with encoding some characters.

There is one testcase for special characters. It works for the example strings, but could be more extensive.

Also please note that the search considers only notes by default. If you want to search other things, you have to specify the type argument. For example api.search(query="xyz", type="tag") to search tags.

from joppy.

wujita01 avatar wujita01 commented on August 17, 2024

I have use api.search(query="xyz", type="note") to search it . I find if I create a note use the api, and in a long time ,I can't search any thing about the new note even I have try joplin sync(old notes can be searched properly). but when I try tomorrow ,I can search just use the api.search(query="xyz", type="note") ,I don't modify any command but I can search it now? I can't understand why?

by the way, I use the terminal version of joplin, does it matter?

from joppy.

marph91 avatar marph91 commented on August 17, 2024

There was already some issue about the search being slow. I will link, if I find it again. I can reproduce a delay between creating and searching the note of 5-10 seconds with the desktop version. There shouldn't be a big difference between terminal and desktop version.

Testcase:

    def test_note_search(self):
        self.api.add_notebook()
        self.api.add_note(title="test_title", body="test_content")
        for iteration in range(10):
            print(f"{iteration=}", self.api.search(query="test_content"))
            time.sleep(1)

Output:

$ python -m unittest test.test_api.Search.test_note_search
iteration=0 {'items': [], 'has_more': False}
iteration=1 {'items': [], 'has_more': False}
iteration=2 {'items': [], 'has_more': False}
iteration=3 {'items': [], 'has_more': False}
iteration=4 {'items': [], 'has_more': False}
iteration=5 {'items': [], 'has_more': False}
iteration=6 {'items': [], 'has_more': False}
iteration=7 {'items': [{'id': '8fc4b281aafc4aebb8d5b4051d93abfb', 'parent_id': '73cdaee3a814482d8d4acc64cd25813a', 'title': 'test_title'}], 'has_more': False}
iteration=8 {'items': [{'id': '8fc4b281aafc4aebb8d5b4051d93abfb', 'parent_id': '73cdaee3a814482d8d4acc64cd25813a', 'title': 'test_title'}], 'has_more': False}
iteration=9 {'items': [{'id': '8fc4b281aafc4aebb8d5b4051d93abfb', 'parent_id': '73cdaee3a814482d8d4acc64cd25813a', 'title': 'test_title'}], 'has_more': False}
.
----------------------------------------------------------------------
Ran 1 test in 19.247s

OK

So in this case, the search returns the correct results only after 8 seconds. It might be more for larger or more notes. I assume this is a limitation of the Joplin search itself rather than the API. Could you check if the notes are searchable after ~10 seconds?

from joppy.

marph91 avatar marph91 commented on August 17, 2024

Hi @wujita01, could you resolve the issue?

from joppy.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.