Skip to content

Optimize Search Buissness Logic, Backend #3

@Insax

Description

@Insax

Check in

Check in in new branch feature/smartsearch/backend

Idea:

We optimize the search function to increase useablility which is pretty broke right now.

Implementation:

The :tag1, tag2, tag3: Keyword System stays, we just optimize it.
a.) Ajax request will be vars now (Done by frontend designer):
keyword (nullable, string)
actualTag (nullable, string)
prevTags (nullable, jsonFormat)

b.) keyword / detection and formatting is in frontend, we just work with the passed values
Remove old tag / keyword detection

If only the keyword is given:

Select from database where title like '%keyword%' -> in eloquent orm.

if only tags are given and no keyword

The target is to autocomplete the "actual tag" or append content - depending on some occourences

if only the field actualTag is given: select all tags which are LIKE 'actualTag%' and return them (json encode)

also return all notes which have tags LIKE 'actualTag%' (json encode)

if we have field actualTag and prevTags is given:

like before return all accourences to actualTag
return all notes which have ALL of the GIVEN tags (AND LOGIC)

if we have prevTags and Keyword

no longer autocomplete anything
return notes which have ANY of the tags, but LIKE '%KEYWORD%' (tags are or logic, keyword is AND logic with tags)

Create an own custom form request validator to check if the request is valid

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions