Related
I have a schema published into an elastic, and I want to know if is possible add a lowercase normalizer when the index is published in order to update that field and avoid define a new schema object with all old fields and the new one.
Currently I am triying to update that field with this command:
await this.getClient().indices.putSettings({index: indexName, body:{
softwarePublisher: {
type: "text",
fields: {
ngram: {
type: "text",
analyzer: "software_analyzer",
search_analyzer: "software_search_analyzer",
},
raw: {
type: "keyword",
},
rawl: {
type: "keyword",
normalizer: "lowercase_normalizer",
},
},
},
}});
But I got the following error:
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"unknown
setting [index.softwarePublisher.fields.ngram.analyzer] please check
that any required plugins are installed, or check the breaking changes
documentation for removed
settings"}],"type":"illegal_argument_exception","reason":"unknown
setting [index.softwarePublisher.fields.ngram.analyzer] please check
that any required plugins are installed, or check the breaking changes
documentation for removed
settings","suppressed":[{"type":"illegal_argument_exception","reason":"unknown
setting [index.softwarePublisher.fields.ngram.search_analyzer] please
check that any required plugins are installed, or check the breaking
changes documentation for removed
settings"},{"type":"illegal_argument_exception","reason":"unknown
setting [index.softwarePublisher.fields.ngram.type] please check that
any required plugins are installed, or check the breaking changes
documentation for removed
settings"},{"type":"illegal_argument_exception","reason":"unknown
setting [index.softwarePublisher.fields.raw.type] please check that
any required plugins are installed, or check the breaking changes
documentation for removed
settings"},{"type":"illegal_argument_exception","reason":"unknown
setting [index.softwarePublisher.fields.rawl.normalizer] please check
that any required plugins are installed, or check the breaking changes
documentation for removed
settings"},{"type":"illegal_argument_exception","reason":"unknown
setting [index.softwarePublisher.fields.rawl.type] please check that
any required plugins are installed, or check the breaking changes
documentation for removed
settings"},{"type":"illegal_argument_exception","reason":"unknown
setting [index.softwarePublisher.type] please check that any required
plugins are installed, or check the breaking changes documentation for
removed settings"}]},"status":400}
I tried to with putMappings but anyway I got an error.
EDIT
Elastic version
curl -XGET 'http://localhost:9200'
{
"name" : "bf9cd8c528fc",
"cluster_name" : "docker-cluster",
"cluster_uuid" : "MzMfZzJaQwia1A5U5SFzNg",
"version" : {
"number" : "7.1.1",
"build_flavor" : "default",
"build_type" : "docker",
"build_hash" : "7a013de",
"build_date" : "2019-05-23T14:04:00.380842Z",
"build_snapshot" : false,
"lucene_version" : "8.0.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
EDIT 2
Error using putMapping
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Root
mapping definition has unsupported parameters: [publisher :
{type=text, fields={rawl={normalizer=lowercase_normalizer,
type=keyword}, raw={type=keyword},
ngram={search_analyzer=software_search_analyzer,
analyzer=software_analyzer,
type=text}}}]"}],"type":"mapper_parsing_exception","reason":"Root
mapping definition has unsupported parameters: [publisher :
{type=text, fields={rawl={normalizer=lowercase_normalizer,
type=keyword}, raw={type=keyword},
ngram={search_analyzer=software_search_analyzer,
analyzer=software_analyzer, type=text}}}]"},"status":400}
Analyzer
export const softwareNameAnalyzer = {
filter: {
ngram_custom: {
type: "edge_ngram",
min_gram: "1",
max_gram: "15",
},
},
tokenizer: {
software_tokenizer,
},
normalizer: {
lowercase_normalizer: {
filter: ["lowercase"],
},
},
analyzer: {
software_search_analyzer: defaultAnalyzer,
software_analyzer: softwareAnalyzer,
default: defaultAnalyzer,
default_search: defaultAnalyzer,
},
};
export const softwareAnalyzer = {
type: "custom",
tokenizer: "software_tokenizer",
char_filter: ["html_strip"],
filter: ["lowercase", "ngram_custom"],
};
Any idea?
Thanks?
First off, you should use putMappings() not putSettings() since you're defining fields.
Then you must invoke putMappings() as follows (you're missing the properties section):
await this.getClient().indices.putMappings({index: indexName, body:{
properties: { <<----- add this
softwarePublisher: {
...
}
}
}});
Note: You need to make sure to invoke putSettings() before putMappings so that your custom analyzers are installed first, otherwise the putMappings() call will complain that your custom analyzers don't exist.
I can able to search the case by company name
var mySearch = search.create({
type: search.Type.SUPPORT_CASE,
columns: [{
name: 'title'
}, {
name: 'company'
}],
filters: [{
name: 'company',
operator: 'is',
values: 'Test'
}]
});
return mySearch.run({
ld: mySearch.id
}).getRange({
start: 0,
end: 1000
});
But I am not able to search case by company id.
companyId is 115
Below are not working
i)
filters: [{
name: 'company',
operator: 'is',
values: 115
}]
ii)
filters: [{
name: 'companyid',
operator: 'is',
values: 115
}]
According to the Case schema company is a Text filter, meaning you would have to provide it with the precise Name of the company, not the internal ID.
Instead you may want to use the customer.internalid joined filter to provide the internal ID. Also, Internal ID fields are nearly always Select fields, meaning they do not accept the is operator, but instead require the anyof or noneof operator.
You can find the valid operators by field type on the Help page titled Search Operators
First, you can try this :
var supportcaseSearchObj = search.create({
type: "supportcase",
filters:
[
["company.internalid","anyof","100"]
],
columns:
[
search.createColumn({
name: "casenumber",
sort: search.Sort.ASC
}),
"title",
"company",
"contact",
"stage",
"status",
"profile",
"startdate",
"createddate",
"category",
"assigned",
"priority"
]
});
Second : how did I get this ? The answer is hint that will make your life easier :
Install the "NetSuite Saved Search Code Export" chrome plugin.
In Netsuite UI, create your saved search (it is always easier that doing it in code).
After saving the search, open it again for edition.
At the top right corner (near list, search menu in the netsuite page), you will see a link "Export as script" : click on it and you will get your code ;)
If you can not install the chrome plugin :
In Netsuite UI, create your saved search (it is always easier that doing it in code).
In your code, load your saved search
Add a log.debug to show the [loadedesearchVar].filters
You can then copy what you will see in the log to use it as your search filters.
Good luck!
Creating a python flask rest plus server application,
I'm trying to create a model for input body (in POST operation) with 'allOf' operator,
which is equivalent to the following example, taken from swagger.yaml I've created with the swagger editor:
definitions:
XXXOperation:
description: something...
properties:
oper_type:
type: string
enum:
- oper_a
- oper_b
- oper_c
operation:
allOf:
- $ref: '#/definitions/OperA'
- $ref: '#/definitions/OperB'
- $ref: '#/definitions/OperC'
It should be something like (just in my crazy imagination):
xxx_oper_model = api.model('XXXOperation', {
'oper_type': fields.String(required=True, enum['oper_a', 'oper_b', 'oper_c']),
'operation': fields.Nested([OperA, OperB, OperC], type='anyof')
})
when OperA, OperB, OperC are also defined as models.
How can I do that?
Actually, I prefer to use 'oneOf', but as I understand it's not supported even in the swagger editor, so I try to use the 'allOf' with not required fields.
Versions: flask restplus: 0.10.1, flask: 0.12.2, python: 3.6.2
Thanks a lot
You need to use api.inherit. As mentioned in page 30 of documentation example;
parent = api.model('Parent', {
'name': fields.String,
'class': fields.String(discriminator=True)
})
child = api.inherit('Child', parent, {
'extra': fields.String
})
this way, Child will have all properties of Parent + its own additional property extra
{
"Child": {
"allOf": [
{
"$ref": "#/definitions/Parent"
},
{
"properties": {
"extra": {
"type": "string"
}
}
}
]
}
}
I try to implement Yammer embedded in Office 365(SharePoint Online). I added this code:
yam.connect.embedFeed({
"container": "#embedded-feed",
"network": "*",
"feedType": "open-graph",
"config": {
promptText: "test",
use_sso: true,
showOpenGraphPreview: false,
header: false,
footer: false,
defaultToCanonical: false
},
objectProperties:
{
url: window.location.href,
title: document.title,
image: "/Style Library/graphics/content/logo.svg",
type: "page"
}
});
The code works in chrome but in Internet Explorer 10 and 11 it won't the same issue happends with there configurator
https://www.yammer.com/widget/configure
Is there a workaround:)
Ok in my case what was causing the problem was the network. The network name wasn't correct
How to get the correct network name:
1. Go tohttps://www.yammer.com/office365/admin
2. In the menu go to Configuration
3. Under General you find Network name.
I try to configure CKEDITOR in Oracle Framework "Endeca v 11.1.0" but something is wrong.
I can only configure toobar like this :
[
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] },
'/',
{ name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] },
{ name: 'colors', items: [ 'TextColor', 'BGColor' ] },
{ name: 'tools', items: [ 'Maximize', 'ShowBlocks' ] },
{ name: 'others', items: [ '-' ] },
{ name: 'about', items: [ 'About' ] }
];
and i cannot configure styles like i want.
By default i have sur styles of ckeditor and it is normal. i have not set a good style.js with good configuration.
I want to configure specific style and i have read somes documentation like this : http://docs.ckeditor.com/#!/guide/dev_styles
but how can i do that in my configuration :
CKEDITOR.stylesSet.add( 'my_styles', [
// Block-level styles
{ name: 'Blue Title', element: 'h2', styles: { 'color': 'Blue' } },
{ name: 'Red Title' , element: 'h3', styles: { 'color': 'Red' } },
// Inline styles
{ name: 'CSS Style', element: 'span', attributes: { 'class': 'my_style' } },
{ name: 'Marker: Yellow', element: 'span', styles: { 'background-color': 'Yellow' } }
]);
How can i set specific style in toolbar configuration only ??
Thx for help
I'm going to give advice that you might not find helpful :) Instead of creating a custom editor for use within Experience Manager (and then having to maintain that during upgrades, etc), it might be better instead to give them an editor UI completely separate from XM. Then, when they have their nice HTML to copy and paste it into XM.
Another idea: Instead of creating a Flex editor directly (like what you're doing), create a light-weight Flex editor that launches a popup window (where that would be a webapp hosted outside of XM directly). Then have that popup window return a block of HMTL as text. This would allow you to create a fancy editor but not be constrained by Flex.
I can't share a full code example for my second recommendation, but in Flex you can open a popup windoww by doing:
ExternalInterface.call("window.open",
popupUrl, "Select Value",
"menubar=1,resizeable=1,width=1000,height=800,location=yes,menubar=yes,scrollbars=1,toolbar=1");
... where popupUrl would be the URL of your exteranl web app.
Then, in the webapp, when you want to pass back a value, you can do:
windowOpener = window.opener.document.xmgrSwfElement;
windowOpener.selectValue(path);
window.close();
In 11.1, configuration file location of CK Editor has been changed. It is moved inside a .jar. Check ToolsAndFrameworks\11.1.0\server\workspace\state\sling_ifcr-11.1.0\startup\25\richTextEditor-11.1.0.jar file for build-config.js
Thx for your answer.
My action :
extract war file "ifcr-11.1.0.war" in
"/ToolsAndFrameworks/11.1.0/server/webapps/ifcr-11.1.0.war"
extract "richTextEditor-11.1.0.jar" in "icfr-11.1.0/WEB-INF/resources/bundles/25"
make modification on file "richTextEditor-11.1.0/content/ckeditor_4.3.3_full/ckeditor/style.js" for my specific style.
I have open build-config.js but i can't see config for styles.
i have rebuild package richTextEditor-11.1.0.jar and ifcr-11.1.0.war and restart tomcat and i can't see modification on ToolsAndFrameworks\11.1.0\server\workspace\state\sling_ifcr-11.1.0\startup\25\richTextEditor-11.1.0.jar.
i have try to delete all files and folder on ToolsAndFrameworks\11.1.0\server\workspace\state\sling_ifcr-11.1.0\startup* and restart tomcat for deploying artifact and other but my folder "ToolsAndFrameworks\11.1.0\server\workspace\state\sling_ifcr-11.1.0\startup\" is empty.
A crazy thing is my webapp run with succes without this folder and files.
are there a cache or other ?