Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
 
Answered
Accessing cache value from different extensions

We attempting to see if a value could be shared between extensions if a value was set in the cache within one extension and grabbed from another.
For example:

  • Extension 1
    self.cache.set(UNIQUE_KEY, value)

  • Extension 2
    value self.cache.get(UNIQUE_KEY)

Would this be possible? Or is the cache on a per-extension basis?

0

Correction for extension 2: value = self.cache.get(UNIQUE_KEY)

— Michael Plohetski   3 years ago
0

As far as I know it is on a per service basis. So you should be able to use it across your extensions exactly as you have it there. If it needs to be tied to a specific session I recommend using self.session_cache.

— Trey Teter   3 years ago
Votes Newest

Answers 2


Hi Michael!

Not sure if it would work for your particular use-case, but Tecton exposes the setTectonCacheObject and getTectonCacheObject capabilities in order to store and retrieve data from the platform cache.

https://cdn4.onlineaccess1.com/cdn/base/tecton/v1.25/Documentation/capabilities/setTectonCacheObject
https://cdn4.onlineaccess1.com/cdn/base/tecton/v1.25/Documentation/capabilities/getTectonCacheObject

Posted 3 years ago

Micheal,

You should be able to put that data in local / session storage or store in a cookie. You could use both of these in JS to set and get cookies:

function setCookie(cname, cvalue, exdays) {
    const d = new Date();
    d.setTime(d.getTime() + exdays);
    let expires = "expires=" + d.toGMTString();
    document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function getCookie(cname) {
    let name = cname + "=";
    let decodedCookie = decodeURIComponent(document.cookie);
    let ca = decodedCookie.split(';');
    for (let i = 0; i < ca.length; i++) {
        let c = ca[i];
        while (c.charAt(0) == ' ') {
            c = c.substring(1);
        }
        if (c.indexOf(name) == 0) {
            return c.substring(name.length, c.length);
        }
    }
    return "";
}
Posted 3 years ago
154 Views
2 Answers
3 years ago
3 years ago
Tags