๐Ÿ” KQL queries

Use KQL to create custom queries.

KQL queries

You can use the KQL query language to select data according to your needs in our dashboard. In the following, you will find some examples for an efficient usage of KQL.

Alternatively to the KQL queries, you can also use the drop-down menus to filter geographically. This alos works for the output of our agents. This shortcut is available in the diagrams below the map and tables. For more information, check out these videos.

Exemplary commands

Find all companies in Mannheim:

district.keyword : "Mannheim, Stadtkreis"

Find all companies in Mannheim that mention โ€œsolarโ€:

district.keyword : "Mannheim, Stadtkreis" and text : "solar"

Find all companies in Mannheim that mention โ€œsolarโ€ and have a high AI_Intensity:

district.keyword : "Mannheim, Stadtkreis" and text : "solar" and ai_intensity_level.keyword: "high"

Wildcards

  • You can use the wildcard * to match parts of a word, and the rest of the word will be matched automatically. For example, dark* will match both darker and darkness.

  • The wildcard can be placed anywhere in the word (e.g., beginning, middle, and end).

  • This will not work with phrases or words within parentheses. For instance, "smart" has more matches than "sma*" even though it should be the other way around; therefore, sentences cannot be searched using wildcards.

  • Wildcards can only be used without parentheses.

Examples (Marked in Blue is the Entry in the KQL Query):

  • Examples That Work:

    • recycl* will find both recycle and recycling and more.

    • plant* will find both plants and plantain and more.

    • p*t will find both paint and plant and more.

    • *able will find both sustainable and manageable and more.

  • Examples That Do Not Work:

    • "recycl*" will not find "recycle" or "recycling".

    • "our plan*" will not find "our plan" or "our planet".

    • "sustainable pack*" will not find "sustainable packaging" or "sustainable package".

  • Another use of the wildcard is main_contact_mail : * will match all entries that have a main contact mail that's not NULL.

  • There is another wildcard ? that does the same but instead of searching for unlimited characters, it only searches for one more character. This makes a difference if you put it at the beginning or in the middle of a word.

  • Using Wildcards in .keyword Columns:

    • Wildcards can be used to fill out columns. For example, *.keyword : โ€œexampleโ€ will search for the keyword example in all columns containing the .keyword column.

    • Due to multiple columns being named .keyword without being attached to an agent but rather to something like title or url, this search would almost result in a complete search of just example.

      • *.keyword : โ€œenergyโ€ results in approximately 630k matches, and energy results in approximately 680k matches.

    • .keyword columns of the following columns are just duplicates of the original column: Address, city, date, description, dl_slot_x, dl_slot_y, incoming_links, links, main_contact_mail, name, NUTS and NUTS_name, outgoing_links, street, Techstack, title, url, zip.

    • Therefore, using wildcards in columns definitely works but columns would have to be adjusted - besides .keywords, there doesnโ€™t seem to be any use of a wildcard to fill out columns.

How to Use a Large Number of Keywords?

  • To search for a large number of keywords in the KQL query, one should use the WebAI Chat Bot and let it provide the query. Here, one should specify if they want it split by AND or OR.

KQL Character Limit:

  • The length limit of a KQL query varies depending on how you create it. If you create the KQL query using the default SharePoint search frontend, the length limit is 2,048 characters.

  • However, KQL queries you create programmatically using the Query object model have a default length limit of 4,096 characters. You can increase this limit up to 20,480 characters by using the MaxKeywordQueryTextLength property or the DiscoveryMaxKeywordQueryTextLength property (for eDiscovery).

Fuzzy KQL Search:

  • Fuzzy search is a type of query that compensates for typos and misspelled terms in the input string.

  • KQL currently does not support fuzzy search; however, one could disable the new KQL Syntax and revert to Lucene Syntax. Lucene supports fuzzy search.

Last updated