Comments (5)
确认了搜索的关键字在Joplin里是有的。但是还是会返回[],表示为空。我用的是terminal版本。
from joppy.
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.
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.
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.
Hi @wujita01, could you resolve the issue?
from joppy.
Related Issues (14)
- get_notes just get 100 notes, not all notes of a given notebook HOT 5
- Check for projects that would benefit from the API
- Creating a new note based on previous note HOT 3
- get_resource: does not work for filedata HOT 5
- slow in my environment HOT 4
- When exporting notes to pdf, the image resource fails to load. HOT 6
- Release notes HOT 1
- body is not stored in NoteData HOT 2
- API.add_note(..) silently fails HOT 5
- add_resource_to_note assumes it is an image HOT 2
- just thanks HOT 1
- Search query can lead to a 403 Client Error: Forbidden for url HOT 4
- Extend the test jobs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from joppy.