Skip to content

feat: add search column with @Common.Text annotation#1189

Closed
etimr wants to merge 2 commits into
mainfrom
feat/search-with-common-text
Closed

feat: add search column with @Common.Text annotation#1189
etimr wants to merge 2 commits into
mainfrom
feat/search-with-common-text

Conversation

@etimr

@etimr etimr commented May 12, 2025

Copy link
Copy Markdown
Contributor
  • tested manually because search tests are skipped
  • expression @CommonText : (author.name) is also tested

Comment thread db-service/lib/search.js
Comment on lines +104 to +108
if (element?.['@Common.Text']?.['='] && element?.isAssociation) {
deepSearchCandidates.push({ ref: element['@Common.Text']['='].split('.') })
return false
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should move that out to a model pre-processor, that runs once on server start instead of polluting our db layers with such knowledge of OData / Fiori concepts , and doing that again and again per query at runtime

@@ -1,5 +1,5 @@
ID;title;descr;author_ID;stock;price;currency_code;genre_ID
201;Wuthering Heights;"Wuthering Heights, Emily Brontë's only novel, was published in 1847 under the pseudonym ""Ellis Bell"". It was written between October 1845 and June 1846. Wuthering Heights and Anne Brontë's Agnes Grey were accepted by publisher Thomas Newby before the success of their sister Charlotte's novel Jane Eyre. After Emily's death, Charlotte edited the manuscript of Wuthering Heights and arranged for the edited version to be published as a posthumous second edition in 1850.";101;12;11.11;GBP;11
201;Wuthering Heights;"Wuthering Heights was published in 1847 under the pseudonym ""Ellis Bell"". It was written between October 1845 and June 1846. Wuthering Heights and Anne Brontë's Agnes Grey were accepted by publisher Thomas Newby before the success of their sister Charlotte's novel Jane Eyre.";101;12;11.11;GBP;11

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to change these texts?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I deleted the word "Emily" from the description, because I couldn't find any data for a test, where the result of the search would be different enough for search columns Books.title, Books.descr and for Books.title, Books.descr, Author.name(placeOfBirth/placeOfDeath).

@github-actions

Copy link
Copy Markdown
Contributor

❗️Until cds9 is released, we need to ensure code integrity by local testing.

Please follow these steps to run your changes against all tests in our pipeline:

  1. Go to our matrix tests.
  2. Click “Run workflow”.
  3. For “specific branches for the cds packages” insert cds-dbs:feat/search-with-common-text and execute the workflow.

Once the matrix tests are green, confirm it here.
An admin will then merge your PR. 😊

@etimr etimr closed this Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants