Commit graph

46 commits

Author SHA1 Message Date
Akhil Narang
a7aa0ded2d
refactor: change filter from tuple to dict
While list/dict both work and technically so does a tuple,
the original intention in #13831 seems to have been a dict.
A trailing comma got left behind, which changed it to a tuple.

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-11-26 11:38:15 +05:30
David Arnold
c114e5fae8
refactor: unit vs integration treewide (#27992)
* refactor: constitute unit test case

* fix: docs and type hints

* refactor: mark presumed integration test cases explicitly

At time of writing, we now have at least two base test classes:

- frappe.tests.UnitTestCase
- frappe.tests.IntegrationTestCase

They load in their perspective priority queue during execution.

Probably more to come for more efficient queing and scheduling.

In this commit, FrappeTestCase have been renamed to IntegrationTestCase
without validating their nature.

* feat: Move test-related functions from test_runner.py to tests/utils.py

* refactor: add bare UnitTestCase to all doctype tests

This should teach LLMs in their next pass that the distinction matters
and that this is widely used framework practice
2024-10-06 09:43:36 +00:00
gavin
3544b87f58
fix(website_search): Avoid recursive loop if _items_to_index is falsy 2024-08-27 14:11:37 +02:00
Akhil Narang
3f1e19de85
refactor(treewide): enable RUF rules
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-21 16:20:28 +05:30
Hussain Nagaria
8d2137c265 docs: consistent doc strings 2023-12-18 18:27:39 +05:30
barredterra
88c8baa9ee refactor: for append to extend, merge list extend
Replace a for append loop with list extend.
Create the list with values instead of creating
an empty list and extending it with another list.
2023-08-09 13:25:39 +02:00
Gavin D'souza
d357af1533 refactor: Add a maxsplit limit to string splits 2023-01-24 19:22:51 +05:30
Ankush Menat
8107781f1c
fix: move filelock imports to functions (#19300) 2022-12-15 15:21:31 +05:30
Ankush Menat
49437f53b4
feat: operation level locking for CLI commands (#19162)
This prevents mistakenly issuing same commands twice which can be
dangerous.

added global lock(s):
- [x] bench build

added site level lock(s):
- [x] bench new-site sitename
- [x] bench --site sitename migrate
- [x] bench install-app appname
- [x] bench build
- [x] bench restore (the code is just meh, needs some cleanup)

closes https://github.com/frappe/frappe/issues/13215
2022-12-08 13:24:43 +05:30
Ankush Menat
3e2d2a703a test: Use FrappeTestCase everywhere 2022-08-17 16:39:42 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30
ChillarAnand
3f21b6707a fix: Use whoosh AsyncWriter to prevent write locks 2022-02-06 08:40:23 +05:30
Ankush Menat
99a6874aff feat: apply boosts on search queries
This gives higher priority to title and match over content.
2021-10-25 09:14:53 +05:30
Ankush Menat
4ef4ecdf01 fix: dont hardcode search fields
FullTextSearch uses name and content
WebsiteSearch uses title and content

Tests were failing because of hardcoded fieldnames which can't be
overridden by inheriting class without rewriting search function.

Made a separate function for defining search fields.
2021-10-25 09:14:48 +05:30
Ankush Menat
56f5b3d1f3 test: make global search tests less flaky 2021-10-24 14:46:02 +05:30
Ankush Menat
cbe673255b fix(ux): allow fuzzy search in website search
FuzzyTerm allows edit distance based fuzzy searching. This means "webho" or
"wabhool" will match "webhook".
2021-10-24 14:46:02 +05:30
ChillarAnand
a298566d13 fix: Use whoosh AsyncWriter to prevent write locks 2021-09-15 16:42:11 +05:30
Gavin D'souza
3446026555 chore: Update header: license.txt => LICENSE
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
2021-09-03 12:02:59 +05:30
Mohammad Hasnain Mohsin Rajan
b4453396f4
fix: website_content_field based indexing fails since fields are not passed correctly(#13907) 2021-08-11 12:23:03 +05:30
Mohammad Hasnain Mohsin Rajan
e9076a1e33
fix: Get title only when necessary (#13831)
* fix: query only if necessary

* fix: titile not found

* chore: linting

* chore: use `not in`

* chore: translate title

* chore: quotes

* chore: quotes
2021-08-04 07:54:56 +00:00
Mohammad Hasnain Mohsin Rajan
266a5511c9
chore: fix sider 2021-07-27 12:31:34 +05:30
hasnain2808
48bc68c130 Merge branch 'develop' of https://github.com/frappe/frappe into add-route-index-build-as-a-background-job 2021-06-20 15:59:17 +05:30
hasnain2808
c7d7c54e2c feat: better indexing 2021-06-18 11:06:52 +05:30
hasnain2808
e71ae4b3fe fix: title needed too 2021-06-18 00:25:31 +05:30
hasnain2808
9bea81e30c feat: website_search_field in doctype doctype
website_search_field to declare the content field
remove the background job execution of search indexing
2021-06-18 00:12:07 +05:30
Suraj Shetty
c5b9815248 fix: Add get_response_content to get page content 2021-05-14 23:43:36 +05:30
Suraj Shetty
18497989dc refactor: Remove render_page from render.py
& replace all usages of render_page with get_response
2021-05-14 21:30:28 +05:30
Gavin D'souza
134b2dcd5c chore: Remove f prefix on plain string 2021-05-11 13:02:45 +05:30
Gavin D'souza
1752e5b0e5 feat(cli): Show progress bar for website search index building 2021-05-07 12:14:00 +05:30
Rushabh Mehta
b2686e0623 fix(routing): removed /space from routing 2021-01-01 12:30:35 +05:30
Shivam Mishra
8772606103 fix: document None is not subscriptable 2020-08-26 11:38:29 +05:30
Shivam Mishra
24c5fbf743 test: fix tests 2020-08-10 21:34:02 +05:30
Shivam Mishra
8d71dad60b feat: delete doc only if valid name is provided 2020-08-10 14:24:00 +05:30
Shivam Mishra
579f5dfc8b fix: test conditions 2020-08-10 14:23:44 +05:30
Shivam Mishra
c72a19f696 fix: reference errors in test 2020-08-10 13:52:11 +05:30
Shivam Mishra
b76a01f28d refactor: add set admin to finally 2020-08-10 12:50:37 +05:30
Shivam Mishra
38909db955 feat: create index if not exists 2020-08-06 19:47:46 +05:30
Shivam Mishra
eab9a27b61 feat: separate create_index function 2020-08-06 19:47:46 +05:30
Shivam Mishra
9c35b7fc88 chore: remove unused variables 2020-08-06 19:47:46 +05:30
Shivam Mishra
a18b81e39d chore: linting fixes 2020-08-06 19:47:46 +05:30
Shivam Mishra
59fe187313 feat: update search and website generator to check index_web_pages_for_search 2020-08-06 19:47:46 +05:30
Shivam Mishra
9e3d3de432 feat: add site indexing command 2020-08-06 19:47:46 +05:30
Shivam Mishra
05ac0591df refactor: use glob to crawl static files
Co-authored-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-08-06 19:47:46 +05:30
Shivam Mishra
9b06881702 chore: remove log/print statements 2020-08-06 19:47:46 +05:30
Shivam Mishra
24a984a0ea feat: add test for FTS 2020-08-06 19:47:46 +05:30
Shivam Mishra
602366e285 feat: separate FTS and website search inside frappe.search 2020-08-06 19:47:46 +05:30