In a taxonomy view, enabling aggregation causes HTML tags in description to be output

I created a view of taxonomy terms and turned on aggregation for the view.

My view shows fields, including the description.

However, when I turn on aggregation, HTML tags are output like this:

**Term name: Addition**
<p>Learn about addition.</p>

When I turn off aggregation, the HTML tags disappear.

Is this a bug in Views?

Elasticsearch 7.8 Nested Aggregation not returning correct data

I have been struggling for a week trying to get correct data out of an Elasticsearch nested aggregtation index. Below is my index mapping and two sample documents inserted. What i want to find is:

  1. Match all documents with the field xforms.sentence.tokens.value equal to 24
  2. Within the matched set of documents do a count of matches grouped by xforms.sentence.tokens.tag where xforms.sentence.tokens.value equal to 24

So as an example in the inserted documents below the output i expect is:

{“JJ”: 1, “NN”: 1}

{
  "_doc": {
    "_meta": {},
    "_source": {},
    "properties": {
      "originalText": {
        "type": "text"
      },
      "testDataId": {
        "type": "text"
      },
      "xforms": {
        "type": "nested",
        "properties": {
          "sentence": {
            "type": "nested"
          },
          "predicate": {
            "type": "nested"
          }
        }
      },
      "corpusId": {
        "type": "text"
      },
      "row": {
        "type": "text"
      },
      "batchId": {
        "type": "text"
      },
      "processor": {
        "type": "text"
      }
    }
  }
}

A sample doc inserted is as follows:

{
    "_id": "28",
    "_source": {
        "testDataId": "5e97e9bef033448b893e485baa0fdf15",
        "originalText": "Some text with the word 24",
        "xforms": [{
            "sentence": {
                "tokens": [{
                        "lemma": "Some",
                        "index": 1,
                        "after": " ",
                        "tag": "JJ",
                        "value": "Some"
                    },
                    {
                        "lemma": "text",
                        "index": 2,
                        "after": " ",
                        "tag": "NN",
                        "value": "text"
                    },
                    {
                        "lemma": "with",
                        "index": 3,
                        "after": " ",
                        "tag": "NN",
                        "value": "with"
                    },
                    {
                        "lemma": "the",
                        "index": 4,
                        "after": "",
                        "tag": "CD",
                        "value": "the"
                    },
                    {
                        "lemma": "word",
                        "index": 5,
                        "after": " ",
                        "tag": "CC",
                        "value": "word"
                    },
                    {
                        "lemma": "24",
                        "index": 6,
                        "after": " ",
                        "tag": "JJ",
                        "value": "24"
                    }
                ],
                "type": "RAW"
            },
            "originalSentence": "Some text with the word 24 in it",
            "id": "e724611d8c024bcb8f0158b60e3df87e"
        }]
    }
},
{
    "_id": "56",
    "_source": {
        "testDataId": "5e97e9bef033448b893e485baa0fad15",
        "originalText": "24 word",
        "xforms": [{
            "sentence": {
                "tokens": [{
                        "lemma": "24",
                        "index": 1,
                        "after": " ",
                        "tag": "NN",
                        "value": "24"
                    },
                    {
                        "lemma": "word",
                        "index": 2,
                        "after": " ",
                        "tag": "JJ",
                        "value": "word"
                    }
                ],
                "type": "RAW"
            },
            "originalSentence": "24 word",
            "id": "e724611d8c024bcb8f0158b60e3d123"
        }]
    }
}

sql server – Efficient way to store Product serialized data and its mapping aggregation

I am planning to store unique product serial numbers into database table which is in large quantity.

Criteria:

  • Per year We are having around 10 million unique random serial numbers at product level.
  • We need to store mapping details of aggregated products into the box with unique box number.
  • Also need to update status of the item within the supply chain.

I am planning to use MSSQLServer database.

  1. creating ProductSequence table with fields

    Product ID,

    Unique SerialNumber

    Mapping Box number

    Current Status

What is the ideal method to design table store update and retrieve the large amount unique data and its mapping.
which will be further useful to track and trace product data.
Is SQLServer is sutable or need to change database to any other technology?

Content Aggregation / Headline Plugin?

I am trying to find a solution to do the following:

  1. be on an article / webpage
  2. click a browser (ideally chrome) extension
  3. input a new headline for the article
  4. plugin publishes the headline with link in a widget / page of your wordpress site

Imagine this as a way to streamline a content curation site similar to the Drudge Report or popurls.com

Does anyone know a solution that would do this?

javascript – What’s the proper way to do MongoDB aggregation query with optional parameters?

I have this api endpoint where i want to lookup a user or multiple users schedule and also specify the month or/and the day when doing the query. My code works, but i feel like there is a better, cleaner way to do this.

From the frontend i do a get request that has the following query params.

http://localhost:5000/api/schedule/?name=John Doe&name=Sam Smith&month=July 2020&day=Wed Jul 15 2020 00:00:00 GMT+0300

then this api controller will take the req.query obj and use it to do a custom query. I wanted the options like month or day to be optional and still get a result if they are omitted.

    exports.find_by_query = async (req, res) => {
      let day;
      let month;
      let name;
      const query = ({ $match: {} });
      const filter = { name: {} };
    
      if (req.query.name) {
        name = req.query.name;
        filter.name = { $in: name };
        query(0).$match = filter;
      }
    
      if (req.query.day) {
        const date = new Date(req.query.day);
        date.setHours(0, 0, 0, 0);
        day = date.toString().split("(Eastern European Summer Time)")(0).trim();
      }
    
      if (req.query.month) {
        month = req.query.month;
      }
    
       if (month !== undefined && day === undefined) {
    query.push({
      $group: {
        _id: `$shifts.${month}`,
        count: { $sum: 1 },
        result: { $push: { name: "$name" } },
      },
    });
  }
  if (day !== undefined) {
    query.push({
      $group: {
        _id: `$shifts.${month}.${day}`,
        count: { $sum: 1 },
        result: { $push: { name: "$name", shift: `$shifts.${month}.${day}` } },
      },
    });
  }
      
    
      Schedule.aggregate(query, function (err, user) {
        if (err) {
          res.send(err);
        }
        res.json(user);
      });
    };

This is what the returned json looks like for one user, without specifying the month or day.

(
    {
        "_id": "5f00b12a1607ad69f866cc49",
        "name": "John Doe",
        "shifts": {
            "July 2020": {
                "Wed Jul 01 2020 00:00:00 GMT+0300": {
                    "start": "09:00 AM",
                    "end": "06:00 PM"
                },
                "Thu Jul 02 2020 00:00:00 GMT+0300": {
                    "start": "09:00 AM",
                    "end": "06:00 PM"
                },
                "Fri Jul 03 2020 00:00:00 GMT+0300": {
                    "start": "09:00 AM",
                    "end": "06:00 PM"
                },
                "Sat Jul 04 2020 00:00:00 GMT+0300": {
                    "start": "DO",
                    "end": "DO"
                },

So while this works, i feel that there’s too many steps and doesn’t look readable enough.

Views aggregation for taxonomy based results in views working

I have created a view which lists contacts and groups them by office. However some contacts show up multiple times (I’d assume that is since some use taxonomy for their job titles, and some have more than one job title – but then I noticed even those with a single job role show up more than once so it’s kind of random). Each contact only have one office connected to them.

Aggregated count distinct shows exactly the same items side by side still.

Distinct works for some of them, not in combination with aggregation though so that doesn’t help.
I tried creating a taxonomy based view instead since I read that would be better suited, but the issue is exactly the same.

This is very frustrating, I’ve searched for hours now without any result sadly.
If there is any tutorial I’ve missed or general suggestion I’d be very grateful, I’m at a total loss since it seems like the functionality in views is kind of broken(?).

architecture – design a BI dashboard system – logic of data aggregation on frontend or backend?

I work with a system very similar to a BI dashboard. Basically, suppose the dashboard shows some business metrics for the business, for example, revenue, refunds, number of orders, average order value, etc.

At the front it will display the data for one year, at this time the daily value will be displayed on a line graph for one year. But later, this will start to allow the user to select different aggregation options, as one year data will be aggregated by week, by month, etc. (or it could be 7 days, 14 days, etc., yes, this is still unknown to this day). point). On the backend we are using a big data warehouse (sql) solution and a Node.js server

Now I am considering 3 options, I don't know which approach to choose. If you have experience / ideas to share, it will be really appreciated!

1) the backend aggregation logic, especially the data layer, essentially does aggregation in SQL queries.

pro: 1) fast 2) evolves well if the size of the data increases (let's say that we start to show data over 3 years, more metrics)

con: 1) if the query aggregation logic changes (like from calendar month / week to rollover x days), you might end up rewriting most of the queries (maybe not true, if that's the case) . 2) Requires more work to set up a solid test.

2) aggregation logic on the backend, especially the application layer. Basically, the query returns daily data points and the application manages the aggregation logic.

pro: 1) easier to change if the aggregation logic changes (relatively)

con: 1) slower than having this in the data layer (more network traffic, difference in language performance, more load on the server) 2) worse scales compared to the approach of the data layer

3) Aggregation logic on the frontend, most of the graphics libraries allow to support different aggregation scenarios. The API essentially returns all daily data points.

pro: 1) very flexible if the logic of aggregation changes.

con: 1) slow (network traffic, browser engine, we also support mobile, so it could be very bad on mobile) 2) scales musts

mysql – Apply the aggregation function on a subset of rows, then filter the subset according to the aggregate

I would first filter a table, then calculate the average of some columns in the filtered subset. After that, I would like to further filter the subset based on the returned average. How could I try to do this in a single request?

Here is what my (example) table looks like

| id   | day                 | speed    | name |nor
 1      2017-02-03 00:00:00   -12.3      SYN    10
 2      2018-02-03 00:00:00   -6.36      SYN    13
 3      2015-02-03 00:00:00   -26.36     SYN    24
 4      2017-02-03 00:00:00   -156.36    SYN    16
 5      2017-02-03 00:00:00   -36.36     YRT    136
 6      2017-02-03 00:00:00   -16.36     SYN    13

After the first filter (internal query illustrated below), it would look like this:

|day                    |speed       |nor
 2017-02-03 00:00:00     12.30        10
 2018-02-03 00:00:00      6.36        13
 2017-02-03 00:00:00     16.36        24

Now, for this subset, I would like to find the average of speed and nor and filter the subset again. So, for example, if the average speed of the 3 rows is 13, and average nor is 14, when I filter values ​​lower than avg (speed) and avg (ni), I should get lines 1 and 2.

Here's how I tried it, but it translates to Invalid use of group function Fault. Replacement of WHERE in the external request with HAVING just return a line which is not what I want.

SELECT t1.day, t1.speed, t1.nor FROM (

SELECT report.day AS day, 
        abs(report.speed) AS speed, 
        report.nor AS nor FROM report 
WHERE 
        report.name = 'SYN' 
AND         
        report.day > '2016-01-01 00:00:00' 
AND 
        report.speed 
BETWEEN 
        -40 AND -0.0001
) AS t1 

WHERE 
         t1.speed < AVG(t1.speed) 
AND 
         t1.nor < AVG(t1.speed)

persistence – How to correctly translate UML association, aggregation and composition into a Hibernate mapping?

There are a number of questions about the differences between UML association, aggregation and composition and many answers, some practices and other phylosoficals. Here I ask you to talk about practical differences!

In some responses, I found:

  1. Reference languages ​​like Java can't really implement compositions, because the life cycle of the instance is controlled by garbage collection;
  2. Associations and aggregations have no practical difference, so we just need to delete the aggregations and work with associations and compositions; however, these two types of relationships exist;
  3. These three concepts only make sense in programming languages ​​like C ++, which have an object model based on an instance (and not on a reference);
  4. Aggregation allows many owners, unlike Composition; some sources are different.

However, no answer I have found so far has addressed these concepts in the context of persistent objects. No example has been given regarding persistence, even if it is a very common developmental condition.

When an object persists in a database system, we have a life cycle model free from waste collection, because an instance (or table row if you want) deletion occurs in response to a deliberate act of part of the software implementing a product requirement.

The difference between Association and Composition is indeed very clear, they will produce different annotations in the code. A very noticeable difference is that with a composition, cascading deletion will be activated, so when the owner ID is deleted, items are also deleted. In Association, no cascading deletion is enabled.

However, what differences will we find when annotating association and aggregation, in particular, when in both cases we have a cardinality greater than 1?

The advanced CSS / JS aggregation module breaks the layout of my site

When I activate my Advanced CSS / JS Aggregation module, it breaks the layout of my site. Is there anything I need to do before or after when activating this module.

To fix the site layout, I need to disable the advanced CSS / JS aggregation module and it works again.